use vuex action
This commit is contained in:
parent
45e7f93c49
commit
36376ce57c
2 changed files with 9 additions and 8 deletions
|
@ -95,9 +95,9 @@ export const mutations = {
|
|||
newRights[right] = value
|
||||
set(user, 'rights', newRights)
|
||||
},
|
||||
updateActivationStatus (state, { user: { id }, status }) {
|
||||
updateActivationStatus (state, { user: { id }, deactivated }) {
|
||||
const user = state.usersObject[id]
|
||||
set(user, 'deactivated', !status)
|
||||
set(user, 'deactivated', deactivated)
|
||||
},
|
||||
setCurrentUser (state, user) {
|
||||
state.lastLoginName = user.screen_name
|
||||
|
@ -331,6 +331,12 @@ const users = {
|
|||
return rootState.api.backendInteractor.unsubscribeUser(id)
|
||||
.then((relationship) => commit('updateUserRelationship', [relationship]))
|
||||
},
|
||||
toggleActivationStatus ({ rootState, commit }, user) {
|
||||
rootState.api.backendInteractor.toggleActivationStatus(user)
|
||||
.then(response => {
|
||||
commit('updateActivationStatus', { user, deactivated: response.deactivated })
|
||||
})
|
||||
},
|
||||
registerPushNotifications (store) {
|
||||
const token = store.state.currentUser.credentials
|
||||
const vapidPublicKey = store.rootState.instance.vapidPublicKey
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue