forked from AkkomaGang/akkoma-fe
Clean up addFollowers action
This commit is contained in:
parent
3a689ef8ee
commit
5c43374588
1 changed files with 7 additions and 11 deletions
|
@ -189,16 +189,12 @@ const users = {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
addFollowers ({ rootState, commit }, fetchBy) {
|
addFollowers ({ rootState, commit }, fetchBy) {
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
const user = rootState.users.usersObject[fetchBy]
|
const user = rootState.users.usersObject[fetchBy]
|
||||||
const page = user.followersPage || 1
|
const page = user.followersPage || 1
|
||||||
rootState.api.backendInteractor.fetchFollowers({ id: user.id, page })
|
return rootState.api.backendInteractor.fetchFollowers({ id: user.id, page })
|
||||||
.then((followers) => {
|
.then((followers) => {
|
||||||
commit('addFollowers', { id: user.id, followers, page })
|
commit('addFollowers', { id: user.id, followers, page })
|
||||||
resolve(followers)
|
return followers
|
||||||
}).catch(() => {
|
|
||||||
reject()
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
clearFriendsAndFollowers ({ commit }, userKey) {
|
clearFriendsAndFollowers ({ commit }, userKey) {
|
||||||
|
|
Loading…
Reference in a new issue