mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
simplify 'push dns records' callback
This commit is contained in:
parent
64ae24facd
commit
038ad92f00
1 changed files with 6 additions and 7 deletions
|
@ -124,7 +124,9 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
getDnsChanges () {
|
getDnsChanges () {
|
||||||
api.post(
|
this.loading = true
|
||||||
|
|
||||||
|
return api.post(
|
||||||
`domains/${this.name}/dns/push?dry_run`, {}, null, { wait: false, websocket: false }
|
`domains/${this.name}/dns/push?dry_run`, {}, null, { wait: false, websocket: false }
|
||||||
).then(dnsChanges => {
|
).then(dnsChanges => {
|
||||||
function getLongest (arr, key) {
|
function getLongest (arr, key) {
|
||||||
|
@ -196,12 +198,9 @@ export default {
|
||||||
`domains/${this.name}/dns/push${this.force ? '?force' : ''}`,
|
`domains/${this.name}/dns/push${this.force ? '?force' : ''}`,
|
||||||
{},
|
{},
|
||||||
{ key: 'domains.push_dns_changes', name: this.name }
|
{ key: 'domains.push_dns_changes', name: this.name }
|
||||||
).then(responseData => {
|
).then(async responseData => {
|
||||||
if (isEmptyValue(responseData)) {
|
await this.getDnsChanges()
|
||||||
this.dnsChanges = null
|
if (!isEmptyValue(responseData)) {
|
||||||
} else {
|
|
||||||
this.loading = true
|
|
||||||
this.getDnsChanges()
|
|
||||||
this.dnsErrors = Object.keys(responseData).reduce((acc, key) => {
|
this.dnsErrors = Object.keys(responseData).reduce((acc, key) => {
|
||||||
const args = key === 'warnings'
|
const args = key === 'warnings'
|
||||||
? { icon: 'warning', variant: 'warning' }
|
? { icon: 'warning', variant: 'warning' }
|
||||||
|
|
Loading…
Reference in a new issue