Fix return code for email toggle to let the UI correctly react

This commit is contained in:
Johannes Zellner
2018-01-23 15:35:02 +01:00
parent 7e5afcfe6a
commit a2241a4e47
3 changed files with 6 additions and 6 deletions

View File

@@ -1206,8 +1206,8 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
Client.prototype.enableMailForDomain = function (domain, enabled, callback) {
post('/api/v1/mail/' + domain + '/enable', { enabled: enabled }).success(function (data, status) {
if (status !== 202 || typeof data !== 'object') return callback(new ClientError(status, data));
callback(null, data);
if (status !== 202) return callback(new ClientError(status, data));
callback(null);
}).error(defaultErrorHandler(callback));
};