diff options
| author | shpuld <shp@cock.li> | 2019-01-31 21:11:28 +0200 |
|---|---|---|
| committer | shpuld <shp@cock.li> | 2019-01-31 21:11:28 +0200 |
| commit | 8ce513ed09124fa0183943c359950f49ebcf2f89 (patch) | |
| tree | a3a54f7ee6bec7a288a88028a6b2368e46b0a538 /src/modules | |
| parent | fbe7af3d56e4e6e168208a511bd7cd4e4e4e7a40 (diff) | |
initial draft for follows/following pagination
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/users.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/modules/users.js b/src/modules/users.js index d6ab47ea..ca8e5606 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -1,5 +1,5 @@ import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js' -import { compact, map, each, merge } from 'lodash' +import { compact, map, each, merge, concat } from 'lodash' import { set } from 'vue' import { registerPushNotifications, unregisterPushNotifications } from '../services/push/push.js' import oauthApi from '../services/new_api/oauth' @@ -54,7 +54,8 @@ export const mutations = { // TODO Clean after ourselves? addFriends (state, { id, friends }) { const user = state.usersObject[id] - user.friends = friends + console.log(user.friends) + user.friends = concat(user.friends, friends) }, addFollowers (state, { id, followers }) { const user = state.usersObject[id] @@ -115,12 +116,12 @@ const users = { store.rootState.api.backendInteractor.fetchUser({ id }) .then((user) => store.commit('addNewUsers', [user])) }, - addFriends ({ rootState, commit }, { id }) { - rootState.api.backendInteractor.fetchFriends({ id }) + addFriends ({ rootState, commit }, { id, page }) { + rootState.api.backendInteractor.fetchFriends({ id, page }) .then((friends) => commit('addFriends', { id, friends })) }, - addFollowers ({ rootState, commit }, { id }) { - rootState.api.backendInteractor.fetchFollowers({ id }) + addFollowers ({ rootState, commit }, { id, page }) { + rootState.api.backendInteractor.fetchFollowers({ id, page }) .then((followers) => commit('addFollowers', { id, followers })) }, registerPushNotifications (store) { |
