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
+7 -3
View File
@@ -2,10 +2,14 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import * as api from "../service/TicketServiec";
import { AddMessageTicketType, CreateCategoryType } from "../types/TicketTypes";
export const useGetTickets = (status: string, customerId?: string) => {
export const useGetTickets = (
status: string,
customerId?: string,
page?: number
) => {
return useQuery({
queryKey: ["tickets", status, customerId],
queryFn: () => api.getTickets(status, customerId),
queryKey: ["tickets", status, customerId, page],
queryFn: () => api.getTickets(status, customerId, page),
});
};