make the tests work

This commit is contained in:
Girish Ramakrishnan
2021-06-29 09:44:16 -07:00
parent 31498afe39
commit ea430b255b
11 changed files with 461 additions and 371 deletions

View File

@@ -124,7 +124,7 @@ async function del(req, res, next) {
if (req.user.id === req.resource.id) return next(new HttpError(409, 'Not allowed to remove yourself.'));
if (users.compareRoles(req.user.role, req.resource.role) < 0) return next(new HttpError(403, `role '${req.resource.role}' is required but user has only '${req.user.role}'`));
const [error] = await safe(users.remove(req.resource, auditSource.fromRequest(req)));
const [error] = await safe(users.del(req.resource, auditSource.fromRequest(req)));
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(204));