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