diff --git a/src/actions/commentVote/index.ts b/src/actions/commentVote/index.ts index 53be3d0c3..069d38134 100644 --- a/src/actions/commentVote/index.ts +++ b/src/actions/commentVote/index.ts @@ -20,7 +20,7 @@ const voteHandler = async ( return { error: 'Unauthorized' }; } - const { questionId, answerId, commentId, voteType, currentPath } = data; + const { questionId, answerId, commentId, voteType, currentPath, slug } = data; if (!questionId && !answerId && !commentId) { return { error: 'No valid target specified.' }; @@ -142,7 +142,7 @@ const voteHandler = async ( } if (currentPath) { - revalidatePath(currentPath); + revalidatePath(`${currentPath}/${slug}`); } return { data: updatedEntity }; diff --git a/src/actions/commentVote/schema.ts b/src/actions/commentVote/schema.ts index 28cb1552a..9e1b6bb67 100644 --- a/src/actions/commentVote/schema.ts +++ b/src/actions/commentVote/schema.ts @@ -7,4 +7,5 @@ export const VoteHandleSchema = z.object({ answerId: z.number().optional(), voteType: z.nativeEnum(VoteType), currentPath: z.string(), + slug: z.string(), }); diff --git a/src/app/admin/add-course/page.tsx b/src/app/admin/add-course/page.tsx index dace4c5a8..d4b6d5609 100644 --- a/src/app/admin/add-course/page.tsx +++ b/src/app/admin/add-course/page.tsx @@ -1,12 +1,7 @@ 'use client'; import { Button } from '@/components/ui/button'; -import { - Card, - CardContent, - CardHeader, - CardTitle, -} from '@/components/ui/card'; +import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Form, FormControl, @@ -29,7 +24,7 @@ import { AccordionContent, AccordionItem, AccordionTrigger, -} from "@/components/ui/accordion"; +} from '@/components/ui/accordion'; import { Cuboid, PackagePlus } from 'lucide-react'; import { FaDiscord } from 'react-icons/fa'; @@ -86,24 +81,32 @@ export default function Courses() { return (
- -
+
-

View Content

+

View Content

- + - -
- New course + +
+ + New course
-
-
Create new course for 100xdevs community and let user explore new courses
-
- +
+
+ Create new course for 100xdevs community and let user explore + new courses +
+
+ {/* Create a new course */} Fill in the course details below @@ -121,7 +124,11 @@ export default function Courses() { Title - + @@ -134,7 +141,11 @@ export default function Courses() { Image url - + @@ -144,11 +155,12 @@ export default function Courses() { control={form.control} name="description" render={({ field }: { field: any }) => ( - + Description