pagination with limit

This commit is contained in:
hamid zarghami
2026-07-22 15:39:20 +03:30
parent 96d750fc88
commit 9aadb8e6ad
4 changed files with 237 additions and 217 deletions
@@ -1,10 +1,8 @@
import axios from "../../../config/axios";
import { CreateCustomerType } from "../types/CustomerTypes";
export const getCustomers = async (page: number, withoutPaginate?: boolean) => {
const { data } = await axios.get(
`/users/customers?page=${page}&paginate=${withoutPaginate ? "0" : "1"}`
);
export const getCustomers = async (page: number, limit: number, withoutPaginate?: boolean) => {
const { data } = await axios.get(`/users/customers?page=${page}&limit=${limit}&paginate=${withoutPaginate ? "0" : "1"}`);
return data;
};
@@ -28,10 +26,7 @@ export const getDetailCustomer = async (id: string) => {
return data;
};
export const updateCustomer = async (
id: string,
params: CreateCustomerType
) => {
export const updateCustomer = async (id: string, params: CreateCustomerType) => {
const { data } = await axios.patch(`/users/customers/${id}`, params);
return data;
};