diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2021-01-27 13:13:10 +0200 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2021-01-27 13:13:10 +0200 |
| commit | 06f795d1d656d18d87015e3a52e090d6396a03ab (patch) | |
| tree | 296d864cee5949cb6c6d15acd9c9b4afb4583467 /src/modules/reports.js | |
| parent | e73553dca726703f83e5085560377bfaa202a5f9 (diff) | |
add proper state switcher
Diffstat (limited to 'src/modules/reports.js')
| -rw-r--r-- | src/modules/reports.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/modules/reports.js b/src/modules/reports.js index 3ede42c6..e800cfed 100644 --- a/src/modules/reports.js +++ b/src/modules/reports.js @@ -1,4 +1,3 @@ -import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js' import filter from 'lodash/filter' const reports = { @@ -44,12 +43,14 @@ const reports = { }, setReportState ({ commit, rootState }, { id, state }) { const oldState = rootState.reports.reports[id].state + console.log(oldState, state) commit('setReportState', { id, state }) - backendInteractorService.setReportState({ id, state }).then(report => { + rootState.api.backendInteractor.setReportState({ id, state }).then(report => { console.log(report) }).catch(e => { console.error('Failed to set report state', e) - commit('setReportState', { id, oldState }) + commit('setReportState', { id, state: oldState }) + console.log(oldState) }) }, addReport ({ commit }, report) { |
