diff options
| author | Shpuld Shpludson <shp@cock.li> | 2019-07-15 19:09:01 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2019-07-15 19:09:01 +0000 |
| commit | 3370dd80dc4644f2bff053b97b18698cd2abb550 (patch) | |
| tree | 0f4ad9f266eafada88cf6314a276f30257a1f116 /src/modules/users.js | |
| parent | 7ed9d17ce745abc38a27d4994452a136357aba46 (diff) | |
| parent | e9b452575b9a5ef87808898086771ae806fc3a8b (diff) | |
Merge branch 'develop' into 'feat/conversation-muting'
# Conflicts:
# src/services/api/api.service.js
Diffstat (limited to 'src/modules/users.js')
| -rw-r--r-- | src/modules/users.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/modules/users.js b/src/modules/users.js index 6c7a96f6..57d3a3e3 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -1,5 +1,4 @@ import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js' -import userSearchApi from '../services/new_api/user_search.js' import oauthApi from '../services/new_api/oauth.js' import { compact, map, each, merge, last, concat, uniq } from 'lodash' import { set } from 'vue' @@ -136,6 +135,7 @@ export const mutations = { user.following = relationship.following user.muted = relationship.muting user.statusnet_blocking = relationship.blocking + user.subscribed = relationship.subscribing } }) }, @@ -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 @@ -356,14 +364,7 @@ const users = { }) }, searchUsers (store, query) { - // TODO: Move userSearch api into api.service - return userSearchApi.search({ - query, - store: { - state: store.rootState, - getters: store.rootGetters - } - }) + return store.rootState.api.backendInteractor.searchUsers(query) .then((users) => { store.commit('addNewUsers', users) return users |
