| 123456789101112131415161718192021222324252627282930313233343536373839 |
- import { API_ENDPOINT } from "./endpointDef";
-
- export const loginApi = async (payload) => {
- const result = await fetch(API_ENDPOINT + 'api/auth/local', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify(payload)
- })
-
- const res = await result.json();
-
- return res;
- };
-
- export const registerApi = async (payload) => {
- const result = await fetch(API_ENDPOINT + 'api/auth/local/register', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify(payload)
- })
-
- const res = await result.json();
-
- return res;
- };
-
- export const googleApi = async (accessToken) => {
- const result = await fetch('https://9dae-178-220-74-194.eu.ngrok.io/' + `api/auth/google/callback?access_token=${accessToken}`);
-
- const res = await result.json();
-
- return res;
- };
-
|