вывод нормальной ошибки от сервера + фикс установки режима работы передатчика
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
this.submitStatus.{{ g['group'] }} = true
|
||||
fetch('/api/set/{{ g["group"] }}', {method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(query) })
|
||||
.then(async (resp) => { this.update{{ g['group'] | title }}Settings(await resp.json()) })
|
||||
.then(async (resp) => { let vals = await resp.json(); if (vals['status'] !== 'ok') { throw new Error(vals['error'] ? vals['error'] : "Server returns undefined error") } this.update{{ g['group'] | title }}Settings(vals) })
|
||||
.catch((reason) => { alert(`Ошибка при применении настроек: ${reason}`) })
|
||||
.finally(() => { this.submitStatus.{{ g['group'] }} = false })
|
||||
},
|
||||
|
@@ -63,6 +63,7 @@
|
||||
body: JSON.stringify(query)
|
||||
}).then(async (resp) => {
|
||||
this.submitStatusQos = false
|
||||
if (resp['error']) { throw new Error(resp['error']) }
|
||||
this.updateQosSettings(await resp.json())
|
||||
}).catch((reason) => {
|
||||
this.submitStatusQos = false
|
||||
|
Reference in New Issue
Block a user