merge set/addDnsRecords

This also makes the update mail domain route redundant
This commit is contained in:
Girish Ramakrishnan
2018-07-25 10:44:59 -07:00
parent fa30312cea
commit c09ae963e9
4 changed files with 37 additions and 83 deletions

View File

@@ -4,7 +4,6 @@ exports = module.exports = {
getDomain: getDomain,
addDomain: addDomain,
getDomainStats: getDomainStats,
updateDomain: updateDomain,
removeDomain: removeDomain,
setDnsRecords: setDnsRecords,
@@ -83,18 +82,6 @@ function getDomainStats(req, res, next) {
mailProxy(req, res, next);
}
function updateDomain(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
assert.strictEqual(typeof req.params.domain, 'string');
mail.updateDomain(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 setDnsRecords(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
assert.strictEqual(typeof req.params.domain, 'string');