25 lines
413 B
TypeScript
25 lines
413 B
TypeScript
import axios from "axios";
|
|
|
|
const API_BASE_URL = "http://localhost:8000";
|
|
|
|
export const registerUser = async (userData: {
|
|
username: string;
|
|
email: string;
|
|
phone_number: string;
|
|
password: string;
|
|
}) => {
|
|
const response = await axios.post(
|
|
`${API_BASE_URL}/user/register`,
|
|
{
|
|
...userData,
|
|
shop_id: 0
|
|
},
|
|
{
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
}
|
|
}
|
|
);
|
|
return response.data;
|
|
};
|