Skip to content

Commit

Permalink
Merge pull request #281 from bettersg/bug/can't-change-info-votes-on-…
Browse files Browse the repository at this point in the history
…frontend

send truth score of null when category is not info
  • Loading branch information
sarge1989 authored Apr 9, 2024
2 parents 9d5f157 + 04e7148 commit 387da13
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions checkers-app/src/components/vote/VoteCategories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -106,9 +106,8 @@ export default function VoteCategories(Prop: PropType) {
<>
<Button
className={`flex flex-row items-center justify-start gap-2 max-w-md space-x-3 text-sm
${
category === cat.name ? "bg-primary-color3" : "bg-primary-color"
}`}
${category === cat.name ? "bg-primary-color3" : "bg-primary-color"
}`}
key={index}
onClick={() => handleVote(cat.name)}
>
Expand Down

0 comments on commit 387da13

Please sign in to comment.