-
-
+
+
+
+
+
diff --git a/apps/web/app/modules/Admin/AddCourse/hooks/useAddCourseForm.tsx b/apps/web/app/modules/Admin/AddCourse/hooks/useAddCourseForm.tsx
index c899d764f..86f5a55b2 100644
--- a/apps/web/app/modules/Admin/AddCourse/hooks/useAddCourseForm.tsx
+++ b/apps/web/app/modules/Admin/AddCourse/hooks/useAddCourseForm.tsx
@@ -17,7 +17,6 @@ export const useAddCourseForm = () => {
defaultValues: {
title: "",
description: "",
- state: "draft",
categoryId: "",
imageUrl: "",
},
@@ -25,10 +24,10 @@ export const useAddCourseForm = () => {
const onSubmit = (values: AddCourseFormValues) => {
createCourse({
- data: { ...values },
+ data: { ...values, state: "draft" },
}).then(({ data }) => {
queryClient.invalidateQueries({ queryKey: ALL_COURSES_QUERY_KEY });
- navigate(`/admin/courses/${data.id}`);
+ navigate(`/admin/beta-courses/${data.id}`);
});
};
diff --git a/apps/web/app/modules/Admin/AddCourse/validators/addCourseFormSchema.ts b/apps/web/app/modules/Admin/AddCourse/validators/addCourseFormSchema.ts
index 5535fc7c4..8ded61a77 100644
--- a/apps/web/app/modules/Admin/AddCourse/validators/addCourseFormSchema.ts
+++ b/apps/web/app/modules/Admin/AddCourse/validators/addCourseFormSchema.ts
@@ -3,7 +3,6 @@ import { z } from "zod";
export const addCourseFormSchema = z.object({
title: z.string().min(2, "Title must be at least 2 characters."),
description: z.string().min(2, "Description must be at least 2 characters."),
- state: z.enum(["draft", "published"]),
categoryId: z.string().min(1, "Category is required"),
imageUrl: z.union([z.string().url("Invalid image URL"), z.string().length(0)]).optional(),
});
diff --git a/apps/web/app/modules/Admin/EditCourse/CourseSettings/CourseSettings.tsx b/apps/web/app/modules/Admin/EditCourse/CourseSettings/CourseSettings.tsx
index b74e2e3bf..c71d2402a 100644
--- a/apps/web/app/modules/Admin/EditCourse/CourseSettings/CourseSettings.tsx
+++ b/apps/web/app/modules/Admin/EditCourse/CourseSettings/CourseSettings.tsx
@@ -4,6 +4,7 @@ import { useCallback, useMemo, useState } from "react";
import { useUploadFile } from "~/api/mutations/admin/useUploadFile";
import { useCategoriesSuspense } from "~/api/queries/useCategories";
import ImageUploadInput from "~/components/FileUploadInput/ImageUploadInput";
+import { Icon } from "~/components/Icon";
import Editor from "~/components/RichText/Editor";
import { Button } from "~/components/ui/button";
import { Card, CardContent, CardHeader } from "~/components/ui/card";
@@ -68,7 +69,7 @@ const CourseSettings = ({ title, description, categoryId, imageUrl }: CourseSett
return (
-
+
Basic settings
@@ -82,8 +83,8 @@ const CourseSettings = ({ title, description, categoryId, imageUrl }: CourseSett
render={({ field }) => (
@@ -98,7 +99,7 @@ const CourseSettings = ({ title, description, categoryId, imageUrl }: CourseSett
render={({ field }) => (
@@ -120,7 +121,7 @@ const CourseSettings = ({ title, description, categoryId, imageUrl }: CourseSett
render={({ field }) => (