Skip to content

Commit

Permalink
Merge pull request #302 from bettersg/feat/checkers-admin-status-can-…
Browse files Browse the repository at this point in the history
…be-updated

prevent API from updating isAdmin or tier
  • Loading branch information
sarge1989 committed May 4, 2024
2 parents 4f80e77 + 47a36ee commit b51f737
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions functions/src/definitions/api/handlers/patchChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ const patchCheckerHandler = async (req: Request, res: Response) => {
return res.status(400).send("telegramId cannot be updated")
}

if (keys.includes("isAdmin")) {
return res.status(400).send("isAdmin cannot be updated")
}

if (keys.includes("tier")) {
return res.status(400).send("tier cannot be updated")
}

//update checker
await checkerRef.update(body)

Expand Down

0 comments on commit b51f737

Please sign in to comment.