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.ts22
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;
+ }
+};