change list invoce and tickets + pwa + ...
This commit is contained in:
@@ -2,11 +2,11 @@ import axios from "../../../config/axios";
|
||||
import { AddMessageTicketType, CreateCategoryType } from "../types/TicketTypes";
|
||||
|
||||
export const getTickets = async (status: string, customerId?: string) => {
|
||||
let query = `/tickets/admin?status=${status}`;
|
||||
if (customerId) {
|
||||
query += `&userId=${customerId}`;
|
||||
}
|
||||
const { data } = await axios.get(query);
|
||||
const params = new URLSearchParams();
|
||||
if (status) params.append("status", status);
|
||||
if (customerId) params.append("userId", customerId);
|
||||
const query = params.toString();
|
||||
const { data } = await axios.get(`/tickets/admin?${query}`);
|
||||
return data;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user