aboutsummaryrefslogtreecommitdiff
path: root/src/screens
diff options
context:
space:
mode:
authorIvan Chen <ivan@thetaggid.com>2020-09-30 12:49:30 -0400
committerGitHub <noreply@github.com>2020-09-30 12:49:30 -0400
commit7df032689e61110914e063b53af62c5b0922014d (patch)
treea5ee211bc1c59963922cae763e4c0c3f88596939 /src/screens
parent116d9e7052e1dc64ec023c8480138d5abe9fa81e (diff)
updated onboarding to use edit-profile endpoint (#41)
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/onboarding/ProfileOnboarding.tsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/screens/onboarding/ProfileOnboarding.tsx b/src/screens/onboarding/ProfileOnboarding.tsx
index ea045434..814cd82e 100644
--- a/src/screens/onboarding/ProfileOnboarding.tsx
+++ b/src/screens/onboarding/ProfileOnboarding.tsx
@@ -21,7 +21,7 @@ import {OnboardingStackParams} from '../../routes/onboarding';
import {AuthContext} from '../../routes/authentication';
import ImagePicker from 'react-native-image-crop-picker';
import {
- REGISTER_ENDPOINT,
+ EDIT_PROFILE_ENDPOINT,
websiteRegex,
bioRegex,
genderRegex,
@@ -312,7 +312,7 @@ const ProfileOnboarding: React.FC<ProfileOnboardingProps> = ({route}) => {
return;
}
- const endpoint = REGISTER_ENDPOINT + `${userId}/`;
+ const endpoint = EDIT_PROFILE_ENDPOINT + `${userId}/`;
try {
let response = await fetch(endpoint, {
method: 'PATCH',
@@ -326,7 +326,10 @@ const ProfileOnboarding: React.FC<ProfileOnboardingProps> = ({route}) => {
if (statusCode === 200) {
login(userId, username);
} else if (statusCode === 400) {
- Alert.alert('Profile update failed. 😔', `${data}`);
+ Alert.alert(
+ 'Profile update failed. 😔',
+ data.error || 'Something went wrong! 😭',
+ );
} else {
Alert.alert(
'Something went wrong! 😭',