summaryrefslogtreecommitdiff
path: root/src/store/modules/Operations/KeyClearStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules/Operations/KeyClearStore.js')
-rw-r--r--src/store/modules/Operations/KeyClearStore.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/store/modules/Operations/KeyClearStore.js b/src/store/modules/Operations/KeyClearStore.js
new file mode 100644
index 00000000..1dc96e0f
--- /dev/null
+++ b/src/store/modules/Operations/KeyClearStore.js
@@ -0,0 +1,25 @@
+import api from '@/store/api';
+import i18n from '@/i18n';
+
+const KeyClearStore = {
+ namespaced: true,
+ actions: {
+ async clearEncryptionKeys(_, selectedKey) {
+ const selectedKeyForClearing = {
+ Attributes: { hb_key_clear_request: selectedKey },
+ };
+ return await api
+ .patch(
+ '/redfish/v1/Systems/system/Bios/Settings',
+ selectedKeyForClearing
+ )
+ .then(() => i18n.t('pageKeyClear.toast.selectedKeyClearedSuccess'))
+ .catch((error) => {
+ console.log('Key clear', error);
+ throw new Error(i18n.t('pageKeyClear.toast.selectedKeyClearedError'));
+ });
+ },
+ },
+};
+
+export default KeyClearStore;