diff options
| author | taehoon <th.dev91@gmail.com> | 2019-03-19 04:53:11 -0400 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-05-03 11:40:05 -0400 |
| commit | 2cda9010df6192b008515b2138a2e071473bc40b (patch) | |
| tree | b753369b2c9803fa5c0cae0e70895f5d0dfae0cc /src/modules/reports.js | |
| parent | 0438031da44a70816716de40625541d569a49c85 (diff) | |
add user reporting modal
Diffstat (limited to 'src/modules/reports.js')
| -rw-r--r-- | src/modules/reports.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/modules/reports.js b/src/modules/reports.js new file mode 100644 index 00000000..b712cfeb --- /dev/null +++ b/src/modules/reports.js @@ -0,0 +1,33 @@ +import filter from 'lodash/filter' + +const reports = { + state: { + userId: null, + statuses: [], + modalActivated: false + }, + mutations: { + openUserReportingModal (state, { userId, statuses }) { + state.userId = userId + state.statuses = statuses + state.modalActivated = true + }, + closeUserReportingModal (state) { + state.modalActivated = false + } + }, + actions: { + openUserReportingModal ({ rootState, commit }, userId) { + const statuses = filter(rootState.statuses.allStatuses, status => status.user.id === userId) + commit('openUserReportingModal', { userId, statuses }) + }, + closeUserReportingModal ({ commit }) { + commit('closeUserReportingModal') + }, + reportUser ({ commit }, payload) { + console.log('payload', payload) + } + } +} + +export default reports |
