diff options
author | Ivan Chen <ivan@tagg.id> | 2021-05-10 20:18:47 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-10 20:18:47 -0400 |
commit | c05aa193a244c052f7950104b859a557922e8983 (patch) | |
tree | 9573402104499453dcd761a0289187bdbc4ea005 /src/services/UserProfileService.ts | |
parent | 49136f4056cb40f43d282d534aacf27076f47d8b (diff) | |
parent | 14c4ec9f5350c11b263e3e84b6f5298cb592de9b (diff) |
Merge pull request #411 from grusuTagg/tma823-onboarding-revamp
[TMA-823] Onboarding Revamp
Diffstat (limited to 'src/services/UserProfileService.ts')
-rw-r--r-- | src/services/UserProfileService.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/services/UserProfileService.ts b/src/services/UserProfileService.ts index c11d874f..8b7b78e1 100644 --- a/src/services/UserProfileService.ts +++ b/src/services/UserProfileService.ts @@ -11,6 +11,7 @@ import { PROFILE_INFO_ENDPOINT, PROFILE_PHOTO_ENDPOINT, REGISTER_ENDPOINT, + REGISTER_VALIDATE_ENDPOINT, SEND_OTP_ENDPOINT, TAGG_CUSTOMER_SUPPORT, USER_PROFILE_ENDPOINT, @@ -432,3 +433,29 @@ export const visitedUserProfile = async (userId: string) => { return undefined; } }; + +export const verifyExistingInformation = async ( + email: string | undefined, + username: string | undefined, +) => { + try { + const form = new FormData(); + if (email) { + form.append('email', email); + } + if (username) { + form.append('username', username); + } + const response = await fetch(REGISTER_VALIDATE_ENDPOINT, { + method: 'POST', + headers: { + 'Content-Type': 'multipart/form-data', + }, + body: form, + }); + return response.status===200; + } catch (error) { + console.log(error); + return false; + } +}; |