summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/admin/statistics_panel/store/mutations.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/admin/statistics_panel/store/mutations.js')
-rw-r--r--app/assets/javascripts/admin/statistics_panel/store/mutations.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/assets/javascripts/admin/statistics_panel/store/mutations.js b/app/assets/javascripts/admin/statistics_panel/store/mutations.js
new file mode 100644
index 00000000000..d0fac5cfbab
--- /dev/null
+++ b/app/assets/javascripts/admin/statistics_panel/store/mutations.js
@@ -0,0 +1,16 @@
+import * as types from './mutation_types';
+
+export default {
+ [types.REQUEST_STATISTICS](state) {
+ state.isLoading = true;
+ },
+ [types.RECEIVE_STATISTICS_SUCCESS](state, data) {
+ state.isLoading = false;
+ state.error = null;
+ state.statistics = data;
+ },
+ [types.RECEIVE_STATISTICS_ERROR](state, error) {
+ state.isLoading = false;
+ state.error = error;
+ },
+};