import { API_ENDPOINT } from "./endpointDef"; import apiEndpoints from "./apiEndpoints"; export const loginApi = async (payload) => { const result = await fetch(`${API_ENDPOINT}${apiEndpoints.login}`, { 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}${apiEndpoints.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(`${API_ENDPOINT}${apiEndpoints.googleAuth}${accessToken}`); const res = await result.json(); return res; };