Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { API_ENDPOINT } from "./endpointDef";
  2. import apiEndpoints from "./apiEndpoints";
  3. export const loginApi = async (payload) => {
  4. const result = await fetch(`${API_ENDPOINT}${apiEndpoints.login}`, {
  5. method: 'POST',
  6. headers: {
  7. 'Content-Type': 'application/json'
  8. },
  9. body: JSON.stringify(payload)
  10. })
  11. const res = await result.json();
  12. return res;
  13. };
  14. export const registerApi = async (payload) => {
  15. const result = await fetch(`${API_ENDPOINT}${apiEndpoints.register}`, {
  16. method: 'POST',
  17. headers: {
  18. 'Content-Type': 'application/json'
  19. },
  20. body: JSON.stringify(payload)
  21. })
  22. const res = await result.json();
  23. return res;
  24. };
  25. export const googleApi = async (accessToken) => {
  26. const result = await fetch(`${API_ENDPOINT}${apiEndpoints.googleAuth}${accessToken}`);
  27. const res = await result.json();
  28. return res;
  29. };