diff --git a/src/js/client.js b/src/js/client.js index c4187cad0..eff27704c 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -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); }); }; diff --git a/src/views/email.js b/src/views/email.js index 0ba52770d..d46f826c7 100644 --- a/src/views/email.js +++ b/src/views/email.js @@ -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