From 50f5afbce1f2bc4dbd0ddf6c951c7e519dfc6ce3 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 15 Aug 2022 23:19:33 +0300 Subject: add and remove users to/from lists from their profile --- src/modules/users.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/modules/users.js') 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) => { -- cgit v1.2.3-70-g09d2