diff options
| author | taehoon <th.dev91@gmail.com> | 2019-04-10 13:49:39 -0400 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-04-14 23:41:38 -0400 |
| commit | e7010d73aca4a2555ef55c41de372ebdd28bd799 (patch) | |
| tree | 7e313045c18b7236286ef3332c2d561bd4883864 /src/components/user_profile/user_profile.js | |
| parent | 936eb23bdfeaf40c4844b9e75e083d21bdd9b4d1 (diff) | |
store friends/followers in the global user repository
Diffstat (limited to 'src/components/user_profile/user_profile.js')
| -rw-r--r-- | src/components/user_profile/user_profile.js | 8 |
1 files changed, 4 insertions, 4 deletions
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'] |
