Skip to content

Commit

Permalink
update wins
Browse files Browse the repository at this point in the history
  • Loading branch information
minhd-vu committed Feb 26, 2024
1 parent 77eb503 commit fc95dc0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/api/kill/confirm/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ export async function POST() {
winnerId: players[0].id,
},
});

await prisma.user.update({
where: {
id: players[0].id,
},
data: {
wins: players[0].wins + 1,
},
});
}

return Response.json(null);
Expand Down
9 changes: 9 additions & 0 deletions lib/party.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ export async function removePlayer(email: string) {
winnerId: players[0].id,
},
});

await prisma.user.update({
where: {
id: players[0].id,
},
data: {
wins: players[0].wins + 1,
},
});
}

if (party.started) {
Expand Down

0 comments on commit fc95dc0

Please sign in to comment.