aboutsummaryrefslogtreecommitdiff
path: root/src/components/who_to_follow/who_to_follow.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/who_to_follow/who_to_follow.js')
-rw-r--r--src/components/who_to_follow/who_to_follow.js14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/components/who_to_follow/who_to_follow.js b/src/components/who_to_follow/who_to_follow.js
index be0b8827..ecd97dd7 100644
--- a/src/components/who_to_follow/who_to_follow.js
+++ b/src/components/who_to_follow/who_to_follow.js
@@ -16,19 +16,11 @@ const WhoToFollow = {
methods: {
showWhoToFollow (reply) {
reply.forEach((i, index) => {
- const user = {
- id: 0,
- name: i.display_name,
- screen_name: i.acct,
- profile_image_url: i.avatar || '/images/avi.png'
- }
- this.users.push(user)
-
- this.$store.state.api.backendInteractor.externalProfile(user.screen_name)
+ this.$store.state.api.backendInteractor.fetchUser({ id: i.acct })
.then((externalUser) => {
if (!externalUser.error) {
this.$store.commit('addNewUsers', [externalUser])
- user.id = externalUser.id
+ this.users.push(externalUser)
}
})
})
@@ -36,7 +28,7 @@ const WhoToFollow = {
getWhoToFollow () {
const credentials = this.$store.state.users.currentUser.credentials
if (credentials) {
- apiService.suggestions({credentials: credentials})
+ apiService.suggestions({ credentials: credentials })
.then((reply) => {
this.showWhoToFollow(reply)
})