From c000265df8ad027b36d13c6f9dcbd6f347533bcb Mon Sep 17 00:00:00 2001 From: Sukanya Pandey Date: Thu, 19 Aug 2021 18:08:22 +0530 Subject: Resolve bug for identify LED switch in processor table Bug: While toggling identify LED for cpu0, in return other identify LEDs are also getting toggled which belongs to different CPUs. Signed-off-by: Sukanya Pandey Change-Id: Ic48eba7b391a28f861e38f306233387819ad944c --- src/store/modules/HardwareStatus/ProcessorStore.js | 27 +++++++++------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'src/store/modules/HardwareStatus') diff --git a/src/store/modules/HardwareStatus/ProcessorStore.js b/src/store/modules/HardwareStatus/ProcessorStore.js index c7cbbeea..1c91eacb 100644 --- a/src/store/modules/HardwareStatus/ProcessorStore.js +++ b/src/store/modules/HardwareStatus/ProcessorStore.js @@ -81,22 +81,17 @@ const ProcessorStore = { const updatedIdentifyLedValue = { LocationIndicatorActive: led.identifyLed, }; - return await api - .patch(uri, updatedIdentifyLedValue) - .then(() => dispatch('getProcessorsInfo')) - .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).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') + ); + } + }); }, }, }; -- cgit v1.2.3