From 04e714836332220e84af2f451f02fb142d861e44 Mon Sep 17 00:00:00 2001 From: bingwen Date: Tue, 9 Apr 2024 09:02:45 +0800 Subject: [PATCH] send truth score of null when category is not info --- checkers-app/src/components/vote/VoteCategories.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/checkers-app/src/components/vote/VoteCategories.tsx b/checkers-app/src/components/vote/VoteCategories.tsx index 8971a5d9..f9252b31 100644 --- a/checkers-app/src/components/vote/VoteCategories.tsx +++ b/checkers-app/src/components/vote/VoteCategories.tsx @@ -89,7 +89,7 @@ export default function VoteCategories(Prop: PropType) { const handleSubmitVote = (category: string, truthScore: number | null) => { if (messageId && voteRequestId) { //call api to update vote - patchVote(messageId, voteRequestId, category, truthScore) + patchVote(messageId, voteRequestId, category, category === "info" ? truthScore : null) .then(() => { incrementSessionVotedCount(); navigate("/votes"); @@ -106,9 +106,8 @@ export default function VoteCategories(Prop: PropType) { <>