From be3af3360cec7ba3eb2921662689c437f92e2fc7 Mon Sep 17 00:00:00 2001 From: Yoshie Muranaka Date: Mon, 11 May 2020 08:23:04 -0700 Subject: Add batch actions and row action to Event Logs Adds ability to export and delete event logs by row or in a table batch action. - Modifications to TableRowAction component to allow single row export functionality Signed-off-by: Yoshie Muranaka Change-Id: Ica50dd0868ac85cc2d6925a9448858b40da9c529 --- src/store/api.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/store/api.js') diff --git a/src/store/api.js b/src/store/api.js index 4a8b8e80..63fd75cb 100644 --- a/src/store/api.js +++ b/src/store/api.js @@ -55,3 +55,18 @@ export default { return Axios.spread(callback); } }; + +export const getResponseCount = responses => { + let successCount = 0; + let errorCount = 0; + + responses.forEach(response => { + if (response instanceof Error) errorCount++; + else successCount++; + }); + + return { + successCount, + errorCount + }; +}; -- cgit v1.2.3