order detail + types + components
This commit is contained in:
@@ -1,7 +1,31 @@
|
||||
import axios from "@/config/axios";
|
||||
import type { OrderResponseType } from "../types/Types";
|
||||
import type {
|
||||
AddTicketType,
|
||||
OrderDetailResponseType,
|
||||
OrderResponseType,
|
||||
TicketsResponseType,
|
||||
} from "../types/Types";
|
||||
|
||||
export const getOrders = async () => {
|
||||
const { data } = await axios.get<OrderResponseType>(`/admin/orders`);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getOrderDetail = async (id: string) => {
|
||||
const { data } = await axios.get<OrderDetailResponseType>(
|
||||
`/admin/orders/${id}`
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getTickets = async (orderId: string) => {
|
||||
const { data } = await axios.get<TicketsResponseType>(
|
||||
`/admin/ticket/order/${orderId}`
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const addTicket = async (orderId: string, params: AddTicketType) => {
|
||||
const { data } = await axios.post(`/admin/ticket/order/${orderId}`, params);
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user