Fix mail route tests

This commit is contained in:
Girish Ramakrishnan
2018-01-21 00:40:30 -08:00
parent f4e1b8874c
commit 00c1c42b58
6 changed files with 54 additions and 56 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ function setMailEnabled(req, res, next) {
if (typeof req.body.enabled !== 'boolean') return next(new HttpError(400, 'enabled is required'));
mail.setMailEnabled(req.params.domain, { enabled: req.body.enabled }, function (error) {
mail.setMailEnabled(req.params.domain, !!req.body.enabled, function (error) {
if (error && error.reason === MailError.NOT_FOUND) return next(new HttpError(404, error.message));
if (error && error.reason === MailError.BAD_FIELD) return next(new HttpError(400, error.message));
if (error) return next(new HttpError(500, error));