pagination
This commit is contained in:
@@ -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),
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user