base url for api

This commit is contained in:
haniyeroozmand
2026-03-29 22:07:51 +03:30
parent 6857ac5ee8
commit 3d3b3bc214
2 changed files with 14 additions and 21 deletions

View File

@@ -1,21 +1,13 @@
export const registerUser = async (data:any) => {
const response = await fetch(
"https://parsshop-back.mugit.ir/api/auth/register/password",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(data),
}
);
const result = await response.json();
if (!response.ok) {
throw result;
}
return result;
};
import { API_BASE_URL } from "../config";
export async function registerUser(data: any) {
const res = await fetch(`${API_BASE_URL}/auth/register/password`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
console.log( API_BASE_URL);
return res.json();
}

View File

@@ -0,0 +1 @@
export const API_BASE_URL = "https://parsshop-back.mugit.ir/api";