Skip to content

Commit

Permalink
changed var name
Browse files Browse the repository at this point in the history
  • Loading branch information
RA341 committed Nov 12, 2024
1 parent 2476314 commit e177652
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions devU-api/src/entities/user/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ export async function createNewAdmin(req: Request, res: Response, next: NextFunc
// delete an admin, only an admin can delete an admin
export async function deleteAdmin(req: Request, res: Response, next: NextFunction) {
try {
let newAdminUserId = req.body.newAdminUserId
if (!newAdminUserId) {
let deleteAdminUserId = req.body.newAdminUserId
if (!deleteAdminUserId) {
return res.status(404).send('Not found')
}
await UserService.softDeleteAdmin(newAdminUserId)
res.status(204).send('User is no longer admin')
await UserService.softDeleteAdmin(deleteAdminUserId)
res.status(204)
} catch (e) {
next(e)
}
Expand Down

0 comments on commit e177652

Please sign in to comment.