add route to sync dns records

merge the mail dns route with this one as well

fixes #737
This commit is contained in:
Girish Ramakrishnan
2021-02-24 18:42:39 -08:00
parent 93712c0f03
commit 70fbcf8ce4
8 changed files with 92 additions and 28 deletions

View File

@@ -3,8 +3,6 @@
exports = module.exports = {
getDomain,
setDnsRecords,
getStatus,
setMailFromValidation,
@@ -50,21 +48,6 @@ function getDomain(req, res, next) {
});
}
function setDnsRecords(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
assert.strictEqual(typeof req.params.domain, 'string');
// can take a setup all the DNS entries. this is mostly because some backends try to list DNS entries (DO)
// for upsert and this takes a lot of time
req.clearTimeout();
mail.setDnsRecords(req.params.domain, function (error) {
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(201));
});
}
function getStatus(req, res, next) {
assert.strictEqual(typeof req.params.domain, 'string');