order detail + types + components

This commit is contained in:
hamid zarghami
2026-01-31 11:00:24 +03:30
parent 7df6d04d5f
commit b730f86b1e
11 changed files with 723 additions and 6 deletions
+25 -1
View File
@@ -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;
};