Files
shomal-hospital-ticketing-f…/services/api/ticket.api.ts

21 lines
720 B
TypeScript

import callAPI from "../caller/config";
export async function createTicket(data: any) {
return await callAPI.post("/ticket/create", data).then((res) => res.data);
}
export async function updateTicket(id:string,data: any) {
return await callAPI.put(`/ticket/update/${id}`, data).then((res) => res.data);
}
export async function getAllTickets(params: any) {
return await callAPI.get("/ticket/all", { params }).then((res) => res.data);
}
export async function removeTicket(id: string) {
return await callAPI.delete(`/ticket/remove/${id}`).then((res) => res.data);
}
export async function getAllTicketsExport(params: any) {
return await callAPI.get("/ticket/all/export", { params }).then((res) => res.data);
}