edit print form

This commit is contained in:
hamid zarghami
2026-02-02 16:11:02 +03:30
parent 48136a9f15
commit 199fbe4987
5 changed files with 46 additions and 8 deletions
+9 -1
View File
@@ -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,
});
};
+8
View File
@@ -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;
};
+6 -1
View File
@@ -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;