Skip to content

Commit

Permalink
Merge pull request #328 from a-mnich/fix-admin-api
Browse files Browse the repository at this point in the history
  • Loading branch information
Yooooomi committed Dec 27, 2023
2 parents 6a72ad8 + 944db8b commit b205bfb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/routes/index.ts
Expand Up @@ -137,7 +137,7 @@ router.put(

try {
const users = await getAllAdmins();
if (users.length <= 1) {
if (users.length <= 1 && status === false) {
return res.status(400).send({ code: 'CANNOT_HAVE_ZERO_ADMIN' });
}
await setUserAdmin(id, status);
Expand Down

0 comments on commit b205bfb

Please sign in to comment.