make the tests work
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user