subdomains.del now takes array values

This commit is contained in:
Girish Ramakrishnan
2015-10-30 13:30:19 -07:00
parent 5c4b4d764e
commit d6bff57c7d
4 changed files with 16 additions and 23 deletions
+6 -6
View File
@@ -4,7 +4,7 @@
exports = module.exports = {
add: add,
delSubdomain: delSubdomain,
del: del,
updateSubdomain: updateSubdomain,
getChangeStatus: getChangeStatus,
get: get
@@ -54,7 +54,7 @@ function get(zoneName, subdomain, type, callback) {
var fqdn = subdomain !== '' && type === 'TXT' ? subdomain + '.' + config.fqdn() : config.appFqdn(subdomain);
debug('getSubdomain: zoneName: %s subdomain: %s type: %s fqdn: %s', zoneName, subdomain, type, fqdn);
debug('get: zoneName: %s subdomain: %s type: %s fqdn: %s', zoneName, subdomain, type, fqdn);
superagent
.get(config.apiServerOrigin() + '/api/v1/domains/' + fqdn)
@@ -83,18 +83,18 @@ function updateSubdomain(zoneName, subdomain, type, value, callback) {
});
}
function delSubdomain(zoneName, subdomain, type, value, callback) {
function del(zoneName, subdomain, type, values, callback) {
assert.strictEqual(typeof zoneName, 'string');
assert.strictEqual(typeof subdomain, 'string');
assert.strictEqual(typeof type, 'string');
assert.strictEqual(typeof value, 'string');
assert(util.isArray(values));
assert.strictEqual(typeof callback, 'function');
debug('delSubdomain: %s for domain %s.', subdomain, zoneName);
debug('add: %s for zone %s of type %s with values %j', subdomain, zoneName, type, values);
var data = {
type: type,
values: [ value ]
values: values
};
superagent