diff options
Diffstat (limited to 'src/store/modules/HardwareStatus/AssemblyStore.js')
-rw-r--r-- | src/store/modules/HardwareStatus/AssemblyStore.js | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/store/modules/HardwareStatus/AssemblyStore.js b/src/store/modules/HardwareStatus/AssemblyStore.js index c6ab7cf7..13cdbbc9 100644 --- a/src/store/modules/HardwareStatus/AssemblyStore.js +++ b/src/store/modules/HardwareStatus/AssemblyStore.js @@ -54,17 +54,28 @@ const AssemblyStore = { ], }; - return await api.patch(uri, updatedIdentifyLedValue).catch((error) => { - dispatch('getAssemblyInfo'); - console.log('error', error); - if (led.identifyLed) { - throw new Error(i18n.t('pageInventory.toast.errorEnableIdentifyLed')); - } else { - throw new Error( - i18n.t('pageInventory.toast.errorDisableIdentifyLed'), - ); - } - }); + return await api + .patch(uri, updatedIdentifyLedValue) + .then(() => { + if (led.identifyLed) { + return i18n.t('pageInventory.toast.successEnableIdentifyLed'); + } else { + return i18n.t('pageInventory.toast.successDisableIdentifyLed'); + } + }) + .catch((error) => { + dispatch('getAssemblyInfo'); + console.log('error', error); + if (led.identifyLed) { + throw new Error( + i18n.t('pageInventory.toast.errorEnableIdentifyLed'), + ); + } else { + throw new Error( + i18n.t('pageInventory.toast.errorDisableIdentifyLed'), + ); + } + }); }, }, }; |