Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: fix the issue where the comment_id parameter is forcibly converted to a string, causing a 500 error in the PostgreSQL database interface. #1426

shuai7a1c96d2cbf2
diff --git a/ui/src/components/Comment/index.tsx b/ui/src/components/Comment/index.tsx
index ec42c562..af2ddbd4 100644
--- a/ui/src/components/Comment/index.tsx
+++ b/ui/src/components/Comment/index.tsx
@@ -53,7 +53,7 @@ import './index.scss';
interface IProps {
objectId: string;
mode?: 'answer' | 'question';
- commentId?: string;
+ commentId?: string | null;
children?: React.ReactNode;
}
diff --git a/ui/src/pages/Questions/Detail/components/Answer/index.tsx b/ui/src/pages/Questions/Detail/components/Answer/index.tsx
index 957a60df..bd0ecbb5 100644
--- a/ui/src/pages/Questions/Detail/components/Answer/index.tsx
+++ b/ui/src/pages/Questions/Detail/components/Answer/index.tsx
@@ -169,7 +169,7 @@ const Index: FC<Props> = ({
<Comment
objectId={data.id}
mode="answer"
- commentId={String(searchParams.get('commentId'))}>
+ commentId={searchParams.get('commentId')}>
<Operate
qid={data.question_id}
aid={data.id}
diff --git a/ui/src/pages/Questions/Detail/components/Question/index.tsx b/ui/src/pages/Questions/Detail/components/Question/index.tsx
index 149cd850..f13fa31d 100644
--- a/ui/src/pages/Questions/Detail/components/Question/index.tsx
+++ b/ui/src/pages/Questions/Detail/components/Question/index.tsx
@@ -189,7 +189,7 @@ const Index: FC<Props> = ({ data, initPage, hasAnswer, isLogged }) => {
<Comment
objectId={data?.id}
mode="question"
- commentId={String(searchParams.get('commentId'))}>
+ commentId={searchParams.get('commentId')}>
<Operate
qid={data?.id}
type="question"