Skip to content

Commit

Permalink
Merge pull request #64 from udohjeremiah/dev
Browse files Browse the repository at this point in the history
Fix error.
  • Loading branch information
udohjeremiah authored Feb 16, 2025
2 parents e57f9b2 + 94481ac commit 2f89f3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/api/answers/[id]/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export async function PATCH(request, { params }) {
if (existingVote) {
// user has upvoted or downvoted before
updateFields.upvotes =
upvotesDirection === "up" ? upvotes + 2 : upvotes - 2;
upvotesDirection === "up" ? upvotes - 1 : upvotes + 1;

updateFields.upvotesHistory = upvotesHistory.map((item) =>
item.id === userId
Expand Down

0 comments on commit 2f89f3a

Please sign in to comment.