Skip to content

Commit

Permalink
fix: formatted and added type
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroSuero committed May 9, 2024
1 parent 18b447f commit 4579e2f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/pages/api/votes/[combatId].ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ export const POST: APIRoute = async ({ params, request }) => {
if (!success) return res("Bad request", { status: 400 })

const { voteId } = output
let boxerData;
let boxerData: string | undefined
if (combatData.teams !== undefined) {
boxerData = combatData.teams.find((t) => t === voteId)
}
else {
} else {
boxerData = combatData.boxers.find((b) => b === voteId)
}
if (!boxerData) return res("Boxer not found", { status: 404 })
Expand Down

0 comments on commit 4579e2f

Please sign in to comment.