aboutsummaryrefslogtreecommitdiff
path: root/src/services/UserProfileService.ts
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-02-12 19:31:32 -0500
committerIvan Chen <ivan@tagg.id>2021-02-12 19:31:32 -0500
commit5cdde33f9c35c1d26f47d0a71ee75c635a94ee49 (patch)
tree8edbe5cce80696e7a3aaf98e463acca4c8ba7c21 /src/services/UserProfileService.ts
parentdfff52bb9c7e8a284e465cd90a61ada94a8d6a4e (diff)
now using suggested_people_linked, moved things around
Diffstat (limited to 'src/services/UserProfileService.ts')
-rw-r--r--src/services/UserProfileService.ts47
1 files changed, 8 insertions, 39 deletions
diff --git a/src/services/UserProfileService.ts b/src/services/UserProfileService.ts
index ce9bdda5..fff35370 100644
--- a/src/services/UserProfileService.ts
+++ b/src/services/UserProfileService.ts
@@ -2,20 +2,18 @@ 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, UserType} from '../types';
import {
- PROFILE_PHOTO_ENDPOINT,
- HEADER_PHOTO_ENDPOINT,
GET_FB_POSTS_ENDPOINT,
GET_IG_POSTS_ENDPOINT,
GET_TWITTER_POSTS_ENDPOINT,
- PROFILE_INFO_ENDPOINT,
+ HEADER_PHOTO_ENDPOINT,
PASSWORD_RESET_ENDPOINT,
+ PROFILE_INFO_ENDPOINT,
+ PROFILE_PHOTO_ENDPOINT,
+ PROFILE_PHOTO_THUMBNAIL_ENDPOINT,
+ SEND_OTP_ENDPOINT,
TAGG_CUSTOMER_SUPPORT,
VERIFY_OTP_ENDPOINT,
- SEND_OTP_ENDPOINT,
- PROFILE_PHOTO_THUMBNAIL_ENDPOINT,
- EDIT_PROFILE_ENDPOINT,
} from '../constants';
import {
ERROR_DOUBLE_CHECK_CONNECTION,
@@ -28,6 +26,7 @@ import {
SUCCESS_PWD_RESET,
SUCCESS_VERIFICATION_CODE_SENT,
} from '../constants/strings';
+import {SocialAccountType} from '../types';
export const loadProfileInfo = async (token: string, userId: string) => {
try {
@@ -50,16 +49,11 @@ export const loadProfileInfo = async (token: string, userId: string) => {
tiktok,
university_class,
profile_completion_stage,
- sp_swipe_tutorial,
- // onboarded_sugggested_people,
+ suggested_people_linked,
friendship_status,
friendship_requester_id,
} = info;
birthday = birthday && moment(birthday).format('YYYY-MM-DD');
- console.log(
- 'Suggested People loaded from backend for logged in user: ',
- sp_swipe_tutorial,
- );
return {
name,
biography,
@@ -70,8 +64,7 @@ export const loadProfileInfo = async (token: string, userId: string) => {
tiktok,
university_class,
profile_completion_stage,
- sp_swipe_tutorial,
- onboarded_sugggested_people: false,
+ suggested_people_linked,
friendship_status,
friendship_requester_id,
};
@@ -322,27 +315,3 @@ export const sendOtp = async (phone: string) => {
return false;
}
};
-
-export const editSPSwipeTutorial = async (user: UserType) => {
- try {
- const request = new FormData();
- request.append('sp_swipe_tutorial', 1);
- const endpoint = EDIT_PROFILE_ENDPOINT + `${user.userId}/`;
- const token = await AsyncStorage.getItem('token');
- let response = await fetch(endpoint, {
- method: 'PATCH',
- headers: {
- 'Content-Type': 'multipart/form-data',
- Authorization: 'Token ' + token,
- },
- body: request,
- });
- if (response.status === 200) {
- return true;
- } else {
- return false;
- }
- } catch (error) {
- console.log('Error updating animated tutorial close button press');
- }
-};