Sandeepa Singh | 05887b5 | 2022-01-10 19:19:36 +0530 | [diff] [blame] | 1 | import api from '@/store/api'; |
| 2 | import i18n from '@/i18n'; |
| 3 | |
| 4 | const KeyClearStore = { |
| 5 | namespaced: true, |
| 6 | actions: { |
| 7 | async clearEncryptionKeys(_, selectedKey) { |
| 8 | const selectedKeyForClearing = { |
| 9 | Attributes: { hb_key_clear_request: selectedKey }, |
| 10 | }; |
| 11 | return await api |
| 12 | .patch( |
| 13 | '/redfish/v1/Systems/system/Bios/Settings', |
Ed Tanous | 8132399 | 2024-02-27 11:26:24 -0800 | [diff] [blame] | 14 | selectedKeyForClearing, |
Sandeepa Singh | 05887b5 | 2022-01-10 19:19:36 +0530 | [diff] [blame] | 15 | ) |
| 16 | .then(() => i18n.t('pageKeyClear.toast.selectedKeyClearedSuccess')) |
| 17 | .catch((error) => { |
| 18 | console.log('Key clear', error); |
| 19 | throw new Error(i18n.t('pageKeyClear.toast.selectedKeyClearedError')); |
| 20 | }); |
| 21 | }, |
| 22 | }, |
| 23 | }; |
| 24 | |
| 25 | export default KeyClearStore; |