Fix wrong assert and minor typos

This commit is contained in:
Johannes Zellner
2021-10-27 21:25:43 +02:00
parent 5ece159fba
commit 4356d673bc
3 changed files with 4 additions and 5 deletions

View File

@@ -253,7 +253,7 @@ async function sendInviteEmail(req, res, next) {
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}'`));
let [error] = await safe(users.sendInviteEmail(req.resource, req.body.email, AuditSource.fromRequest(req)));
if (error) return next(BoxError.toHttpError(error));
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(202, {}));
}