Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed the comment filter issue #543

Merged
merged 2 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
}
Loading