customers

This commit is contained in:
hamid zarghami
2025-02-25 16:29:40 +03:30
parent a94f31db04
commit 4d29331b6b
6 changed files with 334 additions and 112 deletions
@@ -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;
};