base url for api
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
1
public/src/services/config.tsx
Normal file
1
public/src/services/config.tsx
Normal file
@@ -0,0 +1 @@
|
||||
export const API_BASE_URL = "https://parsshop-back.mugit.ir/api";
|
||||
Reference in New Issue
Block a user