From 792115326fc6af583f422082537885bc8061d051 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Tue, 8 Dec 2020 23:17:23 -0500 Subject: [TMA-410] Edit Non-Integrated Socials (#126) * removed refs, added KB avoidance, UI done * missed some things * now parsing response correctly from backend * fixed naming * now allow empty strings to un-link a social * hide field if empty, allow empty string, fixed taggs bar not updating bug * Fix bug where non integrated socials do not show up on edit profile page Co-authored-by: Ashm Walia <40498934+ashmgarv@users.noreply.github.com> Co-authored-by: Ashm Walia --- src/services/UserProfileService.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/services') diff --git a/src/services/UserProfileService.ts b/src/services/UserProfileService.ts index e69e4103..c8dbcdd1 100644 --- a/src/services/UserProfileService.ts +++ b/src/services/UserProfileService.ts @@ -1,10 +1,8 @@ -//Abstracted common profile api calls out here - import AsyncStorage from '@react-native-community/async-storage'; import moment from 'moment'; import {Alert} from 'react-native'; import RNFetchBlob from 'rn-fetch-blob'; -import {SocialAccountType, MomentType} from 'src/types'; +import {SocialAccountType} from 'src/types'; import { AVATAR_PHOTO_ENDPOINT, COVER_PHOTO_ENDPOINT, @@ -25,10 +23,9 @@ export const loadProfileInfo = async (token: string, userId: string) => { const status = response.status; if (status === 200) { const info = await response.json(); - let {name, biography, website, birthday, gender} = info; - // user should always have a birthday, but a safety check here + let {name, biography, website, birthday, gender, snapchat, tiktok} = info; birthday = birthday && moment(birthday).format('YYYY-MM-DD'); - return {name, biography, website, birthday, gender}; + return {name, biography, website, birthday, gender, snapchat, tiktok}; } } catch (error) { Alert.alert( -- cgit v1.2.3-70-g09d2