Add a way to re-sync mail DNS records

Also, make restore resync the admin domain record which gets messed
up by the dns setup
This commit is contained in:
Girish Ramakrishnan
2018-03-08 17:26:07 -08:00
parent f284245e16
commit 6bc5add023
4 changed files with 44 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ exports = module.exports = {
get: get,
add: add,
update: update,
del: del,
getStatus: getStatus,
@@ -60,6 +61,18 @@ function add(req, res, next) {
});
}
function update(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
assert.strictEqual(typeof req.params.domain, 'string');
mail.update(req.params.domain, function (error) {
if (error && error.reason === MailError.NOT_FOUND) return next(new HttpError(404, error.message));
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(202));
});
}
function del(req, res, next) {
assert.strictEqual(typeof req.params.domain, 'string');