aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-03-24 12:17:34 -0400
committerIvan Chen <ivan@tagg.id>2021-03-24 12:17:34 -0400
commitfc9564f27ef7b1fd71a25d2081d910e18106035a (patch)
tree990156e695abe7923759b75127d1a759f68b2e22
parent6e054a927c390cbc6aba4185921397cdcd867e33 (diff)
cleaned up code
-rw-r--r--src/store/actions/userX.ts27
1 files changed, 2 insertions, 25 deletions
diff --git a/src/store/actions/userX.ts b/src/store/actions/userX.ts
index 6302eb3c..f32a4d8f 100644
--- a/src/store/actions/userX.ts
+++ b/src/store/actions/userX.ts
@@ -39,38 +39,15 @@ export const loadUserX = (
const token = await getTokenOrLogout(dispatch);
fetchUserProfile(userId, token).then((profile) => {
if (profile) {
- let {
- name,
- biography,
- website,
- birthday,
- gender,
- snapchat,
- tiktok,
- university_class,
- profile_completion_stage,
- suggested_people_linked,
- friendship_status,
- friendship_requester_id,
- } = profile.profile_info;
+ const birthday = profile.profile_info.birthday;
dispatch({
type: userXProfileFetched.type,
payload: {
screenType,
userId,
data: {
- name,
- biography,
- website,
+ ...profile.profile_info,
birthday: birthday && moment(birthday).format('YYYY-MM-DD'),
- gender,
- snapchat,
- tiktok,
- university_class,
- profile_completion_stage,
- suggested_people_linked,
- friendship_status,
- friendship_requester_id,
},
},
});