diff options
Diffstat (limited to 'src/store/api.js')
-rw-r--r-- | src/store/api.js | 15 |
1 files changed, 15 insertions, 0 deletions
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 + }; +}; |