diff options
author | Shravya Ramesh <37447613+shravyaramesh@users.noreply.github.com> | 2020-11-17 18:06:14 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-17 21:06:14 -0500 |
commit | 713d169915a82edfcfe4b44622e3dce8c6adaf0c (patch) | |
tree | 3f0a0a9ef86e80442c4cc5b6b89be24cf1526268 /src/services/UserProfileService.ts | |
parent | 9b4ba92df514ca8c5c92c4f9279144e2c9d49e36 (diff) |
[TMA-382] Edit profile screen (#121)
* added more icon
* a less fat icon
* and the actual icon asset
* bottom drawer skeleton done
* removed warning, better code
* a more completed skeleton done
* bottom drawer done!
* Added content container, sent birthday picker props, minor styling
* differenciating defined and undefined birthdate in birthdate, datepicker
* removed restricting width for TaggDropDown
* Added edit profile screen to navigator stack
* Add EditProfile view, refresh profile view on save
* Removes unnecessary import
* Stores gender and birthdate as part of ProfileType
* Added gender, birthdate, isEditProfile to AuthProv
* Conditional view applied for edit profile button
* Includes discarded changes in previous merge- BD
* removed unused icon
* resolved scary warnings
* added icon to drawer
* Small fix
* minor code improvement
* sc
* fixed birthday bug
* custom gender updation fixed
* small change to birthday default value
* missed something
* cleaned up types! Warnings gone!
* fixed another gender picker bug
* fixed gender bug and cleaned up logic
* removed warning, MUCH better code now
Co-authored-by: Ivan Chen <ivan@thetaggid.com>
Co-authored-by: Ashm Walia <ashmwalia@outlook.com>
Diffstat (limited to 'src/services/UserProfileService.ts')
-rw-r--r-- | src/services/UserProfileService.ts | 7 |
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( |