edit print form
This commit is contained in:
@@ -64,8 +64,16 @@ export const useGetProducts = () => {
|
||||
|
||||
export const useGetAttributes = (id?: number) => {
|
||||
return useQuery({
|
||||
queryKey: ["attributes"],
|
||||
queryKey: ["attributes", id],
|
||||
queryFn: () => api.getAttributes(id),
|
||||
enabled: !!id,
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetOrderItem = (id?: number) => {
|
||||
return useQuery({
|
||||
queryKey: ["order-item", id],
|
||||
queryFn: () => api.getOrderItem(id),
|
||||
enabled: !!id,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -3,6 +3,7 @@ import type {
|
||||
AddTicketType,
|
||||
CreateFinalOrderType,
|
||||
OrderDetailResponseType,
|
||||
OrderItemResponseType,
|
||||
OrderResponseType,
|
||||
TicketsResponseType,
|
||||
} from "../types/Types";
|
||||
@@ -62,3 +63,10 @@ export const getAttributes = async (productId?: number) => {
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getOrderItem = async (itemId?: number) => {
|
||||
const { data } = await axios.get<OrderItemResponseType>(
|
||||
`/admin/orders/item/${itemId}`
|
||||
);
|
||||
return data;
|
||||
};
|
||||
|
||||
@@ -40,7 +40,10 @@ export interface OrderItem {
|
||||
adminDescription: string | null;
|
||||
attachments: string[];
|
||||
printAttachments: null;
|
||||
printAttributes: null;
|
||||
printAttributes?: {
|
||||
value: string;
|
||||
fieldId: number;
|
||||
}[];
|
||||
confirmedAt: string | null;
|
||||
createdAt: string;
|
||||
deletedAt: string | null;
|
||||
@@ -48,6 +51,8 @@ export interface OrderItem {
|
||||
total: string;
|
||||
}
|
||||
|
||||
export type OrderItemResponseType = BaseResponse<OrderItem>;
|
||||
|
||||
export interface Product {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
|
||||
Reference in New Issue
Block a user