aboutsummaryrefslogtreecommitdiff
path: root/src/services/UserProfileService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/UserProfileService.ts')
-rw-r--r--src/services/UserProfileService.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/services/UserProfileService.ts b/src/services/UserProfileService.ts
index 6e1d1ef5..38e04221 100644
--- a/src/services/UserProfileService.ts
+++ b/src/services/UserProfileService.ts
@@ -1,6 +1,7 @@
//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';
@@ -29,8 +30,10 @@ export const loadProfileInfo = async (
const status = response.status;
if (status === 200) {
const info = await response.json();
- let {name, biography, website} = info;
- callback({name, biography, website});
+ let {name, biography, website, birthday, gender} = info;
+ // user should always have a birthday, but a safety check here
+ birthday = birthday && moment(birthday).format('YYYY-MM-DD');
+ callback({name, biography, website, birthday, gender});
}
} catch (error) {
Alert.alert(