refresh zone after changes

master
adb 4 years ago
parent 24ff180ea6
commit 7b13d4ec73

@ -15,7 +15,7 @@ export class DynDnsBot{
Object.keys(this.config.records).forEach(domain => {
this.config.records[domain].forEach(record => {
record.target = newIp;
this.dns.updateRecord(record, domain);
this.dns.updateRecord(record, domain).then(()=>this.dns.refreshZone(domain));
})
});
}

@ -93,7 +93,7 @@ export class OvhApi{
return await this.sendSignedRequest({
path: `/domain/zone/${domain}/record/${id}`,
getMethod: rest=>rest.put,
body: {subDomain, target, ttl, fieldType}
body: {subDomain, target, ttl}
});
}
@ -118,4 +118,11 @@ export class OvhApi{
path: `/domain/zone/${domain}/record/${id}`
});
}
async refreshZone(zone){
return await this.sendSignedRequest({
path: `/domain/zone/${zone}/refresh`,
getMethod: rest=>rest.post
});
}
}
Loading…
Cancel
Save