From 646d197bf181eff7d0df268d5eda2debcda3f4fe Mon Sep 17 00:00:00 2001 From: taehoon Date: Thu, 25 Apr 2019 04:30:08 -0400 Subject: mutate updated relationship to the store --- src/modules/users.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/modules/users.js') diff --git a/src/modules/users.js b/src/modules/users.js index f9b609b4..c7ebbc85 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -305,6 +305,14 @@ const users = { clearFollowers ({ commit }, userId) { commit('clearFollowers', userId) }, + subscribeUser ({ rootState, commit }, id) { + return rootState.api.backendInteractor.subscribeUser(id) + .then((relationship) => commit('updateUserRelationship', [relationship])) + }, + unsubscribeUser ({ rootState, commit }, id) { + return rootState.api.backendInteractor.unsubscribeUser(id) + .then((relationship) => commit('updateUserRelationship', [relationship])) + }, registerPushNotifications (store) { const token = store.state.currentUser.credentials const vapidPublicKey = store.rootState.instance.vapidPublicKey -- cgit v1.2.3-70-g09d2