setDnsRecords API has changed

This commit is contained in:
Girish Ramakrishnan
2021-02-24 22:00:05 -08:00
parent bdbbc78497
commit 5f0ff047d4
2 changed files with 5 additions and 5 deletions

View File

@@ -2175,7 +2175,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
if (error) return callback(error);
if (status !== 204) return callback(new ClientError(status, data));
that.setDnsRecords(domain, callback); // this is done so that an out-of-sync dkim key can be synced
that.setDnsRecords({ domain: domain, type: 'mail' }, callback); // this is done so that an out-of-sync dkim key can be synced
});
};
@@ -2376,12 +2376,12 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
});
};
Client.prototype.setDnsRecords = function (domain, callback) {
post('/api/v1/mail/' + domain + '/dns', {}, null, function (error, data, status) {
Client.prototype.setDnsRecords = function (options, callback) {
post('/api/v1/cloudron/sync_dns', options, null, function (error, data, status) {
if (error) return callback(error);
if (status !== 201) return callback(new ClientError(status, data));
callback(null);
callback(null, data.taskId);
});
};

View File

@@ -280,7 +280,7 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
setDnsRecords: function (callback) {
$scope.incomingEmail.setupDnsBusy = true;
Client.setDnsRecords($scope.domain.domain, function (error) {
Client.setDnsRecords({ domain: $scope.domain.domain, type: 'mail' }, function (error) {
if (error) console.error(error);
$timeout(function () { $scope.incomingEmail.setupDnsBusy = false; }, 2000); // otherwise, it's too fast