From fc9564f27ef7b1fd71a25d2081d910e18106035a Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Wed, 24 Mar 2021 12:17:34 -0400 Subject: cleaned up code --- src/store/actions/userX.ts | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'src') 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, }, }, }); -- cgit v1.2.3-70-g09d2