diff options
author | Ivan Chen <ivan@tagg.id> | 2021-04-21 15:43:03 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-04-21 15:43:03 -0400 |
commit | 0dd0a4ac4343df036a1f16cbde070c524405bd21 (patch) | |
tree | 292a30ce0228560720214645805deb4b89f2eeae /src/services/UserProfileService.ts | |
parent | 5c438df5f6787cdc6c393873a98590cc827667b9 (diff) | |
parent | 4e8e1c0d58424e6b63cfb8470fc0a73c0e6b102b (diff) |
Merge branch 'master' into hotfix-linting-fixup
# Conflicts:
# .eslintrc.js
# src/components/notifications/Notification.tsx
# src/screens/onboarding/legacy/SocialMedia.tsx
# src/screens/onboarding/legacy/WaitlistSuccessScreen.tsx
# src/screens/profile/CategorySelection.tsx
Diffstat (limited to 'src/services/UserProfileService.ts')
-rw-r--r-- | src/services/UserProfileService.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/services/UserProfileService.ts b/src/services/UserProfileService.ts index 9e93d479..c11d874f 100644 --- a/src/services/UserProfileService.ts +++ b/src/services/UserProfileService.ts @@ -14,6 +14,7 @@ import { SEND_OTP_ENDPOINT, TAGG_CUSTOMER_SUPPORT, USER_PROFILE_ENDPOINT, + USER_PROFILE_VISITED_ENDPOINT, VERIFY_OTP_ENDPOINT, } from '../constants'; import { @@ -410,3 +411,24 @@ export const patchEditProfile = async (form: FormData, userId: string) => { throw ERROR_DOUBLE_CHECK_CONNECTION; } }; + +export const visitedUserProfile = async (userId: string) => { + try { + const token = await AsyncStorage.getItem('token'); + const form = new FormData(); + form.append('user_id', userId); + const response = await fetch(USER_PROFILE_VISITED_ENDPOINT, { + method: 'POST', + headers: { + 'Content-Type': 'multipart/form-data', + Authorization: 'Token ' + token, + }, + body: form, + }); + if (response.status !== 200) { + console.error('Failed to submit a profile visit'); + } + } catch (error) { + return undefined; + } +}; |