toggle_activation api is also deprecated

This commit is contained in:
taehoon 2019-11-19 14:41:39 -05:00
parent 36376ce57c
commit 4e4c4af422
3 changed files with 37 additions and 13 deletions

View file

@ -332,10 +332,9 @@ const users = {
.then((relationship) => commit('updateUserRelationship', [relationship]))
},
toggleActivationStatus ({ rootState, commit }, user) {
rootState.api.backendInteractor.toggleActivationStatus(user)
.then(response => {
commit('updateActivationStatus', { user, deactivated: response.deactivated })
})
const api = user.deactivated ? rootState.api.backendInteractor.activateUser : rootState.api.backendInteractor.deactivateUser
api(user)
.then(({ deactivated }) => commit('updateActivationStatus', { user, deactivated }))
},
registerPushNotifications (store) {
const token = store.state.currentUser.credentials