Skip to content

Commit

Permalink
Merge pull request #543 from himanshugupta2168/comment/filter-bug
Browse files Browse the repository at this point in the history
fixed the comment filter issue
  • Loading branch information
hkirat authored May 12, 2024
2 parents 46338bf + a1d7761 commit 278e2c2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@
"prisma": "^5.6.0",
"tailwindcss": "^3.3.0",
"ts-node": "^10.9.2",
"typescript": "^5"
"typescript": "^5.3.2"
}
}
1 change: 1 addition & 0 deletions src/components/CourseView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const CourseView = ({
<Comments
content={{
id: courseContent[0]?.id || 0,
courseId: courseContent[0]?.parentId || 0,
commentCount: courseContent[0]?.commentsCount || 0,
possiblePath,
}}
Expand Down
12 changes: 6 additions & 6 deletions src/components/comment/Comments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const Comments = async ({
}: {
content: {
id: number;
courseId: number;
commentCount: number;
possiblePath: string;
};
Expand All @@ -55,7 +56,6 @@ const Comments = async ({
content.id,
session.user.id,
);

const data = await getComments(q, searchParams.parentId);

if (!content.id) return null;
Expand Down Expand Up @@ -136,7 +136,7 @@ const Comments = async ({
<Link
scroll={false}
href={getUpdatedUrl(
`/courses/${content.possiblePath}`,
`/courses/${content.courseId}/${content.possiblePath}`,
searchParams,
{
tabtype: TabType.mu,
Expand All @@ -148,7 +148,7 @@ const Comments = async ({
<Link
scroll={false}
href={getUpdatedUrl(
`/courses/${content.possiblePath}`,
`/courses/${content.courseId}/${content.possiblePath}`,
searchParams,
{
tabtype: TabType.mr,
Expand All @@ -160,7 +160,7 @@ const Comments = async ({
<Link
scroll={false}
href={getUpdatedUrl(
`/courses/${content.possiblePath}`,
`/courses/${content.courseId}/${content.possiblePath}`,
searchParams,
{
tabtype: TabType.md,
Expand Down Expand Up @@ -191,7 +191,7 @@ const Comments = async ({
<Link
scroll={false}
href={getUpdatedUrl(
`/courses/${content.possiblePath}`,
`/courses/${content.courseId}/${content.possiblePath}`,
searchParams,
{
type: CommentType.DEFAULT,
Expand All @@ -204,7 +204,7 @@ const Comments = async ({
<Link
scroll={false}
href={getUpdatedUrl(
`/courses/${content.possiblePath}`,
`/courses/${content.courseId}/${content.possiblePath}`,
searchParams,
{
type: CommentType.INTRO,
Expand Down
10 changes: 5 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
"incremental": true,
"plugins": [
{
"name": "next",
},
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"],
"@public/*": ["./public/*"],
},
"@public/*": ["./public/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"],
"exclude": ["node_modules"]
}

0 comments on commit 278e2c2

Please sign in to comment.