Skip to content

Commit

Permalink
add party patch error check
Browse files Browse the repository at this point in the history
  • Loading branch information
minhd-vu committed Feb 28, 2024
1 parent 9628130 commit 4a83fa6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/api/party/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ export async function PATCH(req: Request) {
});
}

if (user.party.started) {
return Response.json("Cannot update mode of started parties", {
status: 400,
});
}

if (user.party.adminId !== user.id) {
return Response.json("User must be the admin to adjust party settings", {
status: 403,
Expand Down

0 comments on commit 4a83fa6

Please sign in to comment.