diff options
Diffstat (limited to 'src/store/modules/HardwareStatus/ProcessorStore.js')
-rw-r--r-- | src/store/modules/HardwareStatus/ProcessorStore.js | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/store/modules/HardwareStatus/ProcessorStore.js b/src/store/modules/HardwareStatus/ProcessorStore.js index 29fb9989..49f96208 100644 --- a/src/store/modules/HardwareStatus/ProcessorStore.js +++ b/src/store/modules/HardwareStatus/ProcessorStore.js @@ -81,17 +81,28 @@ const ProcessorStore = { const updatedIdentifyLedValue = { LocationIndicatorActive: led.identifyLed, }; - return await api.patch(uri, updatedIdentifyLedValue).catch((error) => { - dispatch('getProcessorsInfo'); - 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('getProcessorsInfo'); + console.log('error', error); + if (led.identifyLed) { + throw new Error( + i18n.t('pageInventory.toast.errorEnableIdentifyLed'), + ); + } else { + throw new Error( + i18n.t('pageInventory.toast.errorDisableIdentifyLed'), + ); + } + }); }, }, }; |