Update mail domain when domain is updated
This commit is contained in:
@@ -1144,6 +1144,13 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
|
||||
}).error(defaultErrorHandler(callback)); // this doesn't call defaultErrorHandler till we fix domains code to use this directly
|
||||
};
|
||||
|
||||
Client.prototype.updateMailDomain = function (domain, callback) {
|
||||
post('/api/v1/mail/' + domain, { }).success(function (data, status) {
|
||||
if (status !== 202) return callback(new ClientError(status, data));
|
||||
callback(null);
|
||||
}).error(defaultErrorHandler(callback)); // this doesn't call defaultErrorHandler till we fix domains code to use this directly
|
||||
};
|
||||
|
||||
Client.prototype.addDomain = function (domain, provider, config, fallbackCertificate, tlsConfig, callback) {
|
||||
var data = {
|
||||
domain: domain,
|
||||
@@ -1169,12 +1176,14 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
|
||||
config: config,
|
||||
tlsConfig: tlsConfig
|
||||
};
|
||||
var that = this;
|
||||
|
||||
if (fallbackCertificate) data.fallbackCertificate = fallbackCertificate;
|
||||
|
||||
put('/api/v1/domains/' + domain, data).success(function (data, status) {
|
||||
if (status !== 204) return callback(new ClientError(status, data));
|
||||
callback(null);
|
||||
|
||||
that.updateMailDomain(domain, callback); // this is done so that an out-of-sync dkim key can be synced
|
||||
}).error(defaultErrorHandler(callback));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user