From e1776527081aa45169cef9fbf8f166fe99627fc4 Mon Sep 17 00:00:00 2001 From: RA341 Date: Tue, 12 Nov 2024 15:40:09 -0500 Subject: [PATCH] changed var name --- devU-api/src/entities/user/user.controller.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/devU-api/src/entities/user/user.controller.ts b/devU-api/src/entities/user/user.controller.ts index 053e0de..6b5cefc 100644 --- a/devU-api/src/entities/user/user.controller.ts +++ b/devU-api/src/entities/user/user.controller.ts @@ -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) }