Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

accountRequests.js 657B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import apiEndpoints from '../apiEndpoints';
  2. export const createUser = async (
  3. fullName,
  4. username,
  5. email,
  6. password,
  7. address,
  8. address2,
  9. city,
  10. country,
  11. postcode
  12. ) => {
  13. const response = await fetch(apiEndpoints.account.createUser, {
  14. method: 'POST',
  15. body: JSON.stringify({
  16. fullName,
  17. username,
  18. email,
  19. password,
  20. address,
  21. address2,
  22. city,
  23. country,
  24. postcode,
  25. }),
  26. headers: {
  27. 'Content-Type': 'application/json',
  28. },
  29. });
  30. const data = await response.json();
  31. if (!response.ok) {
  32. throw new Error(data.message || 'Something went wrong!');
  33. }
  34. return data;
  35. };