diff options
Diffstat (limited to 'app/assets/javascripts/reports/accessibility_report/store/mutations.js')
-rw-r--r-- | app/assets/javascripts/reports/accessibility_report/store/mutations.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/assets/javascripts/reports/accessibility_report/store/mutations.js b/app/assets/javascripts/reports/accessibility_report/store/mutations.js new file mode 100644 index 00000000000..20d3e5be9a3 --- /dev/null +++ b/app/assets/javascripts/reports/accessibility_report/store/mutations.js @@ -0,0 +1,20 @@ +import * as types from './mutation_types'; + +export default { + [types.SET_ENDPOINT](state, endpoint) { + state.endpoint = endpoint; + }, + [types.REQUEST_REPORT](state) { + state.isLoading = true; + }, + [types.RECEIVE_REPORT_SUCCESS](state, report) { + state.hasError = false; + state.isLoading = false; + state.report = report; + }, + [types.RECEIVE_REPORT_ERROR](state) { + state.isLoading = false; + state.hasError = true; + state.report = {}; + }, +}; |