pagination

This commit is contained in:
hamid zarghami
2025-05-12 11:43:48 +03:30
parent 052280a009
commit cad29d587c
16 changed files with 90 additions and 33 deletions
+6 -1
View File
@@ -1,10 +1,15 @@
import axios from "../../../config/axios";
import { AddMessageTicketType, CreateCategoryType } from "../types/TicketTypes";
export const getTickets = async (status: string, customerId?: string) => {
export const getTickets = async (
status: string,
customerId?: string,
page?: number
) => {
const params = new URLSearchParams();
if (status) params.append("status", status);
if (customerId) params.append("userId", customerId);
if (page) params.append("page", page.toString());
const query = params.toString();
const { data } = await axios.get(`/tickets/admin?${query}`);
return data;