From f11a190192115fbb798dc0ded02d3f383e407922 Mon Sep 17 00:00:00 2001 From: Nikhil Ashoka Date: Thu, 9 May 2024 15:17:44 +0530 Subject: Added toast notification for identify LEDs - Added success toast notification messages for identify LEDs present at Inventory and LEDs page and Overview. - Import of Toast was not present in Overview's Inventory card and DIMM slot table, fixed it. Signed-off-by: Nikhil Ashoka Change-Id: If9ad84e66f6f15616cb8af51b1e84d8d06b1afd0 --- src/store/modules/HardwareStatus/MemoryStore.js | 33 ++++++++++++++++--------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'src/store/modules/HardwareStatus/MemoryStore.js') diff --git a/src/store/modules/HardwareStatus/MemoryStore.js b/src/store/modules/HardwareStatus/MemoryStore.js index 86b77c0a..787a0502 100644 --- a/src/store/modules/HardwareStatus/MemoryStore.js +++ b/src/store/modules/HardwareStatus/MemoryStore.js @@ -73,17 +73,28 @@ const MemoryStore = { const updatedIdentifyLedValue = { LocationIndicatorActive: led.identifyLed, }; - return await api.patch(uri, updatedIdentifyLedValue).catch((error) => { - dispatch('getDimms'); - 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('getDimms'); + 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