From eb1fd5d084a4f8050bf5a48b8bb2a98faec1889c Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Sat, 18 Dec 2021 21:01:53 +0300 Subject: [PATCH] feat: added new field to course model --- .../Forms/CourseForm/CourseForm.tsx | 22 +++++++++++++++++++ .../Forms/CourseForm/CourseForm.validator.ts | 1 + .../Forms/CourseForm/CreateCourseForm.tsx | 1 + .../Forms/CourseForm/EditCourseForm.tsx | 13 ++++++----- src/components/Nav/Mobile/index.tsx | 22 +++++++++---------- src/helpers/index.ts | 3 ++- src/hooks/queries/course/useCreateCourse.ts | 1 + src/hooks/queries/course/useUpdateCourse.ts | 1 + src/interfaces/index.ts | 1 + src/pages/course/course.tsx | 5 ++--- src/pages/courses/edit/edit.tsx | 1 + src/types/index.d.ts | 2 ++ 12 files changed, 53 insertions(+), 20 deletions(-) diff --git a/src/components/Forms/CourseForm/CourseForm.tsx b/src/components/Forms/CourseForm/CourseForm.tsx index bc39571..530b5f1 100644 --- a/src/components/Forms/CourseForm/CourseForm.tsx +++ b/src/components/Forms/CourseForm/CourseForm.tsx @@ -31,6 +31,7 @@ export type InputFields = { image?: File | undefined; category_id: string; description: string; + education_description: string | null; teacher_id: string; }; @@ -84,6 +85,7 @@ const CourseForm: React.FC = ({ onSubmit, buttonLabel, isLo const watchTitle = watch('title'); const watchDescription = watch('description'); + const watchEducationDescription = watch('education_description'); return (
@@ -117,6 +119,26 @@ const CourseForm: React.FC = ({ onSubmit, buttonLabel, isLo + + What you'll learn section +