diff --git a/scripts/categories.ts b/scripts/categories.ts index e19cffe..8e06e82 100644 --- a/scripts/categories.ts +++ b/scripts/categories.ts @@ -7,7 +7,7 @@ async function main(){ await database.category.createMany({ data:[ {name:"Computer Science"}, - {name:"Machience Learning"}, + {name:"Machine Learning"}, {name:"Mathematic"}, {name:"Artificial Intelligence"}, {name:"Chemistry"}, diff --git a/src/actions/getAnalytics.ts b/src/actions/getAnalytics.ts index 3224b4c..2b348fc 100644 --- a/src/actions/getAnalytics.ts +++ b/src/actions/getAnalytics.ts @@ -31,7 +31,6 @@ const getAnalytics = async (userId: string) => { }); const getObjectWithTitlePrice = groudByCourse(purchasedCourses); // {"a":22,"b":34} - console.log(getObjectWithTitlePrice) const objectToArrayKeyValue = Object.entries(getObjectWithTitlePrice).map( ([courseTitle, total]) => ({ name: courseTitle, total: total }) diff --git a/src/actions/getCourse.ts b/src/actions/getCourse.ts index 665befb..38c3154 100644 --- a/src/actions/getCourse.ts +++ b/src/actions/getCourse.ts @@ -49,14 +49,12 @@ export const GetCourses = async ({ }, }); - console.log("courses", courses); const coursesWithProgress: CourseWithProgressWithCategory[] = await Promise.all( courses.map(async (course) => { //if not buy then shows progress null if (course.purchase.length === 0) { - console.log("null") return { ...course, progress: null, @@ -64,7 +62,6 @@ export const GetCourses = async ({ } const progressPercentage = await GetProgress(userId, course.id); - console.log("pp",progressPercentage) return { ...course, diff --git a/src/actions/getProgress.ts b/src/actions/getProgress.ts index fc7e3dd..330d424 100644 --- a/src/actions/getProgress.ts +++ b/src/actions/getProgress.ts @@ -14,9 +14,9 @@ export const GetProgress = async ( id: true, }, }); - console.log("publishedChapters", publishedChapters); //[ { id: '4e4cff83-fc98-4d9a-95a0-85ec21f17173' },... ] + // console.log("publishedChapters", publishedChapters); //[ { id: '4e4cff83-fc98-4d9a-95a0-85ec21f17173' },... ] const publishedChapterIds = publishedChapters.map((chapter) => chapter.id); - console.log("publishedChapterIds", publishedChapterIds); // [ '4e4cff83-fc98-4d9a-95a0-85ec21f17173',... ] + // console.log("publishedChapterIds", publishedChapterIds); // [ '4e4cff83-fc98-4d9a-95a0-85ec21f17173',... ] const validCompletedChapters = await db.userProgress.count({ where: { userId: userId, @@ -26,10 +26,10 @@ export const GetProgress = async ( isCompleted: true, }, }); - console.log("validCompletedChapters", validCompletedChapters); // 0 + // console.log("validCompletedChapters", validCompletedChapters); // 0 const progressPercentage = (validCompletedChapters / publishedChapterIds.length) * 100; - console.log("progressPercentage", progressPercentage); // 0 + // console.log("progressPercentage", progressPercentage); // 0 return progressPercentage; } catch (error) { diff --git a/src/app/(courseShow)/courses/[courseId]/_components/courseCompleteButton.tsx b/src/app/(courseShow)/courses/[courseId]/_components/courseCompleteButton.tsx index adbeb58..ff2d222 100644 --- a/src/app/(courseShow)/courses/[courseId]/_components/courseCompleteButton.tsx +++ b/src/app/(courseShow)/courses/[courseId]/_components/courseCompleteButton.tsx @@ -30,11 +30,6 @@ const CourseCompleteButton = ({ isComplete: !isComplete, } ); - console.log("daataa: ", data); - console.log("isComplete: ", isComplete); - console.log("nextChapterId: ", nextChapterId); - - if(data.success){ if (!isComplete && !nextChapterId) { diff --git a/src/app/(courseShow)/courses/[courseId]/_components/videoPlayer.tsx b/src/app/(courseShow)/courses/[courseId]/_components/videoPlayer.tsx index c93c321..2dd783b 100644 --- a/src/app/(courseShow)/courses/[courseId]/_components/videoPlayer.tsx +++ b/src/app/(courseShow)/courses/[courseId]/_components/videoPlayer.tsx @@ -31,8 +31,6 @@ const VideoPlayers = ({ }: videoPlayerProps) => { const [isReady, setIsReady] = useState(false); const router = useRouter(); - console.log(isReady); - console.log(!isReady); const onEnd = async () => { try { diff --git a/src/app/(dashboard)/(routes)/search/_components/categoriesParent.tsx b/src/app/(dashboard)/(routes)/search/_components/categoriesParent.tsx index b1d627a..b06afe3 100644 --- a/src/app/(dashboard)/(routes)/search/_components/categoriesParent.tsx +++ b/src/app/(dashboard)/(routes)/search/_components/categoriesParent.tsx @@ -17,7 +17,7 @@ const iconMap : Record={ const CategoriesParents = ({item}:categoryProps) => { return ( -
+
{ item.map((category)=>{ return( diff --git a/src/app/(dashboard)/(routes)/search/_components/courseListItem.tsx b/src/app/(dashboard)/(routes)/search/_components/courseListItem.tsx index 449975d..e798f97 100644 --- a/src/app/(dashboard)/(routes)/search/_components/courseListItem.tsx +++ b/src/app/(dashboard)/(routes)/search/_components/courseListItem.tsx @@ -61,13 +61,13 @@ const CourseListItem = ({ diff --git a/src/app/(dashboard)/(routes)/search/page.tsx b/src/app/(dashboard)/(routes)/search/page.tsx index 72a25ae..f264685 100644 --- a/src/app/(dashboard)/(routes)/search/page.tsx +++ b/src/app/(dashboard)/(routes)/search/page.tsx @@ -15,7 +15,6 @@ interface searchParamsProps{ } const SearchPage =async ({searchParams}:searchParamsProps) => { - console.log("ss",searchParams) const { userId } = auth(); @@ -33,7 +32,6 @@ const SearchPage =async ({searchParams}:searchParamsProps) => { userId:userId, ...searchParams }) - console.log("getCourse",getCourse) return ( <>
diff --git a/src/app/(dashboard)/(routes)/teacher/analytics/_components/cart.tsx b/src/app/(dashboard)/(routes)/teacher/analytics/_components/cart.tsx index d4bc52b..84c3353 100644 --- a/src/app/(dashboard)/(routes)/teacher/analytics/_components/cart.tsx +++ b/src/app/(dashboard)/(routes)/teacher/analytics/_components/cart.tsx @@ -15,7 +15,6 @@ interface CartProps{ } const Cart = ({data}:CartProps) => { - console.log("datadata",data) return (
diff --git a/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/attachment-page.tsx b/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/attachment-page.tsx index 1013a18..69f9c2e 100644 --- a/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/attachment-page.tsx +++ b/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/attachment-page.tsx @@ -31,7 +31,6 @@ const AttachmentForm = ({ courseInfo }: obj) => { values ); toogleEditing(); - console.log(data); if (data.success) { toast.success("Updated"); router.refresh(); @@ -44,7 +43,6 @@ const AttachmentForm = ({ courseInfo }: obj) => { const { data } = await axios.delete( `/api/courses/${courseInfo.id}/attachments/${id}` ); - console.log(data); toast.success("Deleted"); router.refresh(); } catch (error) { @@ -98,7 +96,6 @@ const AttachmentForm = ({ courseInfo }: obj) => { {isEditing && ( { - console.log("UUrrll: ", url); if (url) { onSubmit({ url: url }); } diff --git a/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/category-page.tsx b/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/category-page.tsx index 0913b43..6247f5e 100644 --- a/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/category-page.tsx +++ b/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/category-page.tsx @@ -30,9 +30,6 @@ interface obj { }[] } const CategoryForm = ({ courseInfo,options }: obj) => { - console.log("category page course: ", courseInfo ) - console.log("category page options: ", options ) - const router = useRouter(); const [isEditing, setIsEditing] = useState(false); diff --git a/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/image-page.tsx b/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/image-page.tsx index f535aea..811909e 100644 --- a/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/image-page.tsx +++ b/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/_components/image-page.tsx @@ -59,21 +59,21 @@ const ImageForm = ({ courseInfo }: obj) => { d="M33.25 5.25H8.75C6.817 5.25 5.25 6.817 5.25 8.75V33.25C5.25 35.183 6.817 36.75 8.75 36.75H33.25C35.183 36.75 36.75 35.183 36.75 33.25V8.75C36.75 6.817 35.183 5.25 33.25 5.25Z" stroke="#FDFDFD" stroke-width="2" - stroke-linecap="round" + strokeLinecap="round" stroke-linejoin="round" /> @@ -90,7 +90,6 @@ const ImageForm = ({ courseInfo }: obj) => { {isEditing && ( { - console.log("UUrrll: ", url); if (url) { onSubmit({ imageUrl: url }); } diff --git a/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/chapter/[chapterId]/_components/chapter-description-form.tsx b/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/chapter/[chapterId]/_components/chapter-description-form.tsx index b18696c..52357fd 100644 --- a/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/chapter/[chapterId]/_components/chapter-description-form.tsx +++ b/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/chapter/[chapterId]/_components/chapter-description-form.tsx @@ -71,7 +71,6 @@ const ChapterDescriptionForm = ({ chapterInfo, courseId }: obj) => { control={form.control} name="description" render={({ field }) => { - console.log("field", { ...field }); return ( diff --git a/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/chapter/[chapterId]/_components/chapter-video-form.tsx b/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/chapter/[chapterId]/_components/chapter-video-form.tsx index f771dae..0168adb 100644 --- a/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/chapter/[chapterId]/_components/chapter-video-form.tsx +++ b/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/chapter/[chapterId]/_components/chapter-video-form.tsx @@ -63,14 +63,14 @@ const ChapterVideoForm = ({ chapterInfo, courseId }: obj) => { d="M16 13L21.223 16.482C21.2983 16.5321 21.3858 16.5609 21.4761 16.5652C21.5664 16.5695 21.6563 16.5493 21.736 16.5066C21.8157 16.4639 21.8824 16.4004 21.9289 16.3228C21.9754 16.2452 22 16.1565 22 16.066V7.87002C22 7.78204 21.9768 7.69562 21.9328 7.61947C21.8887 7.54332 21.8253 7.48014 21.7491 7.43632C21.6728 7.3925 21.5863 7.36958 21.4983 7.36988C21.4103 7.37017 21.324 7.39368 21.248 7.43802L16 10.5" stroke="white" stroke-width="2" - stroke-linecap="round" + strokeLinecap="round" stroke-linejoin="round" /> diff --git a/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/page.tsx b/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/page.tsx index 0a5a4cb..0b47a20 100644 --- a/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/page.tsx +++ b/src/app/(dashboard)/(routes)/teacher/courses/[courseId]/page.tsx @@ -46,8 +46,6 @@ const SpecificCoursePage = async ({ }, }); - console.log("categories: ", categories); - const requireField = [ course.title, course.description, diff --git a/src/app/(dashboard)/(routes)/teacher/create/page.tsx b/src/app/(dashboard)/(routes)/teacher/create/page.tsx index 8d36b14..a64b07c 100644 --- a/src/app/(dashboard)/(routes)/teacher/create/page.tsx +++ b/src/app/(dashboard)/(routes)/teacher/create/page.tsx @@ -79,7 +79,7 @@ const CreatePage = () => {
- + diff --git a/src/app/api/courses/[courseId]/attachments/[id]/route.ts b/src/app/api/courses/[courseId]/attachments/[id]/route.ts index 45d3d34..8e6b693 100644 --- a/src/app/api/courses/[courseId]/attachments/[id]/route.ts +++ b/src/app/api/courses/[courseId]/attachments/[id]/route.ts @@ -7,7 +7,6 @@ export async function DELETE( { params }: { params: { courseId: string; id: string } } ) { try { - console.log("params::",params) const { userId } = auth(); if (!userId) return new NextResponse("Unauthorized", { status: 401 }); const findAttachment = await db.attachment.findUnique({ diff --git a/src/app/api/courses/[courseId]/chapter/reorder/route.ts b/src/app/api/courses/[courseId]/chapter/reorder/route.ts index adf07cb..1d9b465 100644 --- a/src/app/api/courses/[courseId]/chapter/reorder/route.ts +++ b/src/app/api/courses/[courseId]/chapter/reorder/route.ts @@ -9,7 +9,6 @@ export async function PUT( try { const { userId } = auth(); const { list } = await req.json(); - console.log(list); if (!userId) return NextResponse.json( diff --git a/src/app/api/courses/[courseId]/route.ts b/src/app/api/courses/[courseId]/route.ts index cc20c4e..188caa4 100644 --- a/src/app/api/courses/[courseId]/route.ts +++ b/src/app/api/courses/[courseId]/route.ts @@ -17,7 +17,6 @@ export async function PATCH( if (!userId) return new NextResponse("unauthorized", { status: 401 }); const values = await req.json(); - console.log("route patch", values); const findCourse = await db.course.update({ where: { id: params.courseId, diff --git a/src/app/api/uploadthing/core.ts b/src/app/api/uploadthing/core.ts index d1395c7..8aee896 100644 --- a/src/app/api/uploadthing/core.ts +++ b/src/app/api/uploadthing/core.ts @@ -5,7 +5,6 @@ const f = createUploadthing(); const handleAuth = () => { const { userId } = auth(); -console.log("useridd",userId) if (!userId) { throw new Error("Unauthorized"); } @@ -17,8 +16,6 @@ export const ourFileRouter = { courseImage: f({ image: { maxFileSize: "4MB", maxFileCount: 1 } }) .middleware(() => handleAuth()) .onUploadComplete(async ({ metadata, file }) => { - console.log("Upload complete for userId:", metadata.userId); - console.log("file url", file.url); return { uploadedBy: metadata.userId }; }), courseAttachment: f(["text", "image", "video", "audio", "pdf"]) diff --git a/src/components/ui/combobox.tsx b/src/components/ui/combobox.tsx index 53e836a..8fa2ae5 100644 --- a/src/components/ui/combobox.tsx +++ b/src/components/ui/combobox.tsx @@ -32,10 +32,6 @@ export const Combobox = ({ }: ComboboxProps) => { const [open, setOpen] = React.useState(false) - - console.log("combobox options: ", options ) - console.log("combobox course: ", value ) - return ( @@ -60,9 +56,6 @@ export const Combobox = ({ { - console.log("a",option.value) - console.log("b",option.label) - console.log("c",value.categoryId) onChange(option.value == value.categoryId ? "" : option.value) setOpen(false) }}