diff options
Diffstat (limited to 'src/store/modules/Logs/PostCodeLogsStore.js')
-rw-r--r-- | src/store/modules/Logs/PostCodeLogsStore.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/store/modules/Logs/PostCodeLogsStore.js b/src/store/modules/Logs/PostCodeLogsStore.js index ac470ece..836f9844 100644 --- a/src/store/modules/Logs/PostCodeLogsStore.js +++ b/src/store/modules/Logs/PostCodeLogsStore.js @@ -1,4 +1,5 @@ import api from '@/store/api'; +import i18n from '@/i18n'; const PostCodeLogsStore = { namespaced: true, @@ -33,6 +34,22 @@ const PostCodeLogsStore = { console.log('POST Codes Log Data:', error); }); }, + async deleteAllPostCodeLogs({ dispatch }, data) { + return await api + .post( + '/redfish/v1/Systems/system/LogServices/PostCodes/Actions/LogService.ClearLog' + ) + .then(() => dispatch('getPostCodesLogData')) + .then(() => + i18n.tc('pagePostCodeLogs.toast.successDelete', data.length) + ) + .catch((error) => { + console.log(error); + throw new Error( + i18n.tc('pagePostCodeLogs.toast.errorDelete', data.length) + ); + }); + }, }, }; |