From e7010d73aca4a2555ef55c41de372ebdd28bd799 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Wed, 10 Apr 2019 13:49:39 -0400
Subject: store friends/followers in the global user repository
---
src/components/user_profile/user_profile.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'src/components/user_profile/user_profile.js')
diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js
index d55d1517..4b0072ad 100644
--- a/src/components/user_profile/user_profile.js
+++ b/src/components/user_profile/user_profile.js
@@ -9,8 +9,8 @@ import withList from '../../hocs/with_list/with_list'
const FollowerList = compose(
withLoadMore({
- fetch: (props, $store) => $store.dispatch('addFollowers', props.userId),
- select: (props, $store) => get($store.getters.findUser(props.userId), 'followers', []),
+ fetch: (props, $store) => $store.dispatch('fetchFollowers', props.userId),
+ select: (props, $store) => get($store.getters.findUser(props.userId), 'followerIds', []).map(id => $store.getters.findUser(id)),
destory: (props, $store) => $store.dispatch('clearFollowers', props.userId),
childPropName: 'entries',
additionalPropNames: ['userId']
@@ -20,8 +20,8 @@ const FollowerList = compose(
const FriendList = compose(
withLoadMore({
- fetch: (props, $store) => $store.dispatch('addFriends', props.userId),
- select: (props, $store) => get($store.getters.findUser(props.userId), 'friends', []),
+ fetch: (props, $store) => $store.dispatch('fetchFriends', props.userId),
+ select: (props, $store) => get($store.getters.findUser(props.userId), 'friendIds', []).map(id => $store.getters.findUser(id)),
destory: (props, $store) => $store.dispatch('clearFriends', props.userId),
childPropName: 'entries',
additionalPropNames: ['userId']
--
cgit v1.2.3-70-g09d2