forked from inflection-zone/rean-admin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filtering out the patient and doctor roles for login
- Loading branch information
1 parent
99011d2
commit 814bb2b
Showing
5 changed files
with
102 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { API_CLIENT_INTERNAL_KEY, BACKEND_API_URL } from '$env/static/private'; | ||
|
||
//////////////////////////////////////////////////////////////// | ||
|
||
export const getPersonRolesForPhone = async (phone: string) => { | ||
const headers = {}; | ||
headers['Content-Type'] = 'application/json'; | ||
headers['x-api-key'] = API_CLIENT_INTERNAL_KEY; | ||
const url = BACKEND_API_URL + '/persons/roles-for-phone?phone=' + phone; | ||
const res = await fetch(url, { | ||
method: 'GET', | ||
headers | ||
}); | ||
const response = await res.json(); | ||
console.log('response', response); | ||
return response; | ||
}; | ||
|
||
export const getPersonRolesForEmail = async (email: string) => { | ||
const headers = {}; | ||
headers['Content-Type'] = 'application/json'; | ||
headers['x-api-key'] = API_CLIENT_INTERNAL_KEY; | ||
const url = BACKEND_API_URL + '/persons/roles-for-email?email=' + email; | ||
const res = await fetch(url, { | ||
method: 'GET', | ||
headers | ||
}); | ||
const response = await res.json(); | ||
console.log('response', response); | ||
return response; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters