remove API calls to add/remove mail domain separately
part of cloudron/box#669
This commit is contained in:
+5
-35
@@ -1879,15 +1879,6 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.addMailDomain = function (domain, callback) {
|
||||
post('/api/v1/mail', { domain: domain }, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 201) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.addDomain = function (domain, zoneName, provider, config, fallbackCertificate, tlsConfig, callback) {
|
||||
var data = {
|
||||
domain: domain,
|
||||
@@ -1905,7 +1896,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
if (error) return callback(error);
|
||||
if (status !== 201) return callback(new ClientError(status, data));
|
||||
|
||||
that.addMailDomain(domain, callback);
|
||||
callback();
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1928,24 +1919,6 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.removeMailDomain = function (domain, callback) {
|
||||
var config = {
|
||||
data: {
|
||||
},
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
};
|
||||
|
||||
// FIXME
|
||||
del('/api/v1/mail/' + domain, config, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 204) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.renewCerts = function (domain, callback) {
|
||||
post('/api/v1/cloudron/renew_certs', { domain: domain || null }, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
@@ -1964,14 +1937,11 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
}
|
||||
};
|
||||
|
||||
this.removeMailDomain(domain, function () {
|
||||
// hack: ignore errors until we fix the domains.js
|
||||
del('/api/v1/domains/' + domain, config, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 204) return callback(new ClientError(status, data));
|
||||
del('/api/v1/domains/' + domain, config, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 204) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null);
|
||||
});
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user