customers
This commit is contained in:
@@ -1,6 +1,22 @@
|
||||
import axios from "../../../config/axios";
|
||||
import { CreateCustomerType } from "../types/CustomerTypes";
|
||||
|
||||
export const getCustomers = async () => {
|
||||
const { data } = await axios.get(`/users/customers`);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getProvines = async () => {
|
||||
const { data } = await axios.get(`/address/provinces/list?limit=50`);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getCities = async (id: string) => {
|
||||
const { data } = await axios.get(`/address/provinces/${id}/cities`);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const createCustomer = async (params: CreateCustomerType) => {
|
||||
const { data } = await axios.post(`/users/customer`, params);
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user