Delete all selected event logs
-Earlier all the event logs were deleted ID wise.
-Now when all logs are selected then below API will be called to delete all the logs.
-API : '/redfish/v1/Systems/system/LogServices/EventLog/Actions/LogService.ClearLog'.
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com>
Change-Id: Ib7026a4fe3c324e6a998be747325f379a944f1c8
diff --git a/src/store/modules/Health/EventLogStore.js b/src/store/modules/Health/EventLogStore.js
index bf1de2f..cdfb358 100644
--- a/src/store/modules/Health/EventLogStore.js
+++ b/src/store/modules/Health/EventLogStore.js
@@ -59,6 +59,18 @@
console.log('Event Log Data:', error);
});
},
+ async deleteAllEventLogs({ dispatch }, data) {
+ return await api
+ .post(
+ '/redfish/v1/Systems/system/LogServices/EventLog/Actions/LogService.ClearLog'
+ )
+ .then(() => dispatch('getEventLogData'))
+ .then(() => i18n.tc('pageEventLogs.toast.successDelete', data))
+ .catch((error) => {
+ console.log(error);
+ throw new Error(i18n.tc('pageEventLogs.toast.errorDelete', data));
+ });
+ },
async deleteEventLogs({ dispatch }, uris = []) {
const promises = uris.map((uri) =>
api.delete(uri).catch((error) => {