fix: moderators can delete problems
This commit is contained in:
+2
-2
@@ -199,9 +199,9 @@ export async function createApiRouter() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.role !== 'admin') {
|
if (!isAdministrator(user.role)) {
|
||||||
res.status(StatusCodes.UNAUTHORIZED)
|
res.status(StatusCodes.UNAUTHORIZED)
|
||||||
res.send(`only an admin can delete this entity`)
|
res.send(`only administrators can delete this entity`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user