diff options
| author | Henry Jameson <me@hjkos.com> | 2022-08-15 23:19:33 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2022-08-15 23:19:33 +0300 |
| commit | 50f5afbce1f2bc4dbd0ddf6c951c7e519dfc6ce3 (patch) | |
| tree | 200ab58c3c3cebdcf7acf073096881824184eb3c /src/modules/users.js | |
| parent | 14292d7ed12a806efcf766895bc1c3aa56fd53f8 (diff) | |
add and remove users to/from lists from their profile
Diffstat (limited to 'src/modules/users.js')
| -rw-r--r-- | src/modules/users.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/modules/users.js b/src/modules/users.js index c13beb29..59e8b391 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -170,6 +170,9 @@ export const mutations = { state.relationships[relationship.id] = relationship }) }, + updateUserInLists (state, { id, inLists }) { + state.usersObject[id].inLists = inLists + }, saveBlockIds (state, blockIds) { state.currentUser.blockIds = blockIds }, @@ -291,6 +294,12 @@ const users = { .then((relationships) => store.commit('updateUserRelationship', relationships)) } }, + fetchUserInLists (store, id) { + if (store.state.currentUser) { + store.rootState.api.backendInteractor.fetchUserInLists({ id }) + .then((inLists) => store.commit('updateUserInLists', { id, inLists })) + } + }, fetchBlocks (store) { return store.rootState.api.backendInteractor.fetchBlocks() .then((blocks) => { |
