From 038ad92f00b0f5776716aed1ad26ead3f5617123 Mon Sep 17 00:00:00 2001 From: axolotle Date: Wed, 29 Sep 2021 16:06:05 +0200 Subject: [PATCH] simplify 'push dns records' callback --- app/src/views/domain/DomainDns.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/src/views/domain/DomainDns.vue b/app/src/views/domain/DomainDns.vue index 816e5ee7..5408fa42 100644 --- a/app/src/views/domain/DomainDns.vue +++ b/app/src/views/domain/DomainDns.vue @@ -124,7 +124,9 @@ export default { }, getDnsChanges () { - api.post( + this.loading = true + + return api.post( `domains/${this.name}/dns/push?dry_run`, {}, null, { wait: false, websocket: false } ).then(dnsChanges => { function getLongest (arr, key) { @@ -196,12 +198,9 @@ export default { `domains/${this.name}/dns/push${this.force ? '?force' : ''}`, {}, { key: 'domains.push_dns_changes', name: this.name } - ).then(responseData => { - if (isEmptyValue(responseData)) { - this.dnsChanges = null - } else { - this.loading = true - this.getDnsChanges() + ).then(async responseData => { + await this.getDnsChanges() + if (!isEmptyValue(responseData)) { this.dnsErrors = Object.keys(responseData).reduce((acc, key) => { const args = key === 'warnings' ? { icon: 'warning', variant: 'warning' }