12345678910111213141516171819 |
- import apiEndpoints from "./apiEndpoints";
-
- export const createUser = async (fullName, username, email, password) => {
- const response = await fetch(apiEndpoints.account.createUser, {
- method: "POST",
- body: JSON.stringify({ fullName, username, email, password }),
- headers: {
- "Content-Type": "application/json",
- },
- });
-
- const data = await response.json();
-
- if (!response.ok) {
- throw new Error(data.message || "Something went wrong!");
- }
-
- return data;
- };
|