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

View File

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