add and remove users to/from lists from their profile
This commit is contained in:
parent
14292d7ed1
commit
50f5afbce1
10 changed files with 134 additions and 55 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue