Create order in admin

This commit is contained in:
hamid zarghami
2026-02-01 10:02:45 +03:30
parent 2ced4666c8
commit 5c536667b1
18 changed files with 712 additions and 4 deletions
+22
View File
@@ -1,10 +1,15 @@
import axios from "@/config/axios";
import type {
AddTicketType,
CreateFinalOrderType,
OrderDetailResponseType,
OrderResponseType,
TicketsResponseType,
} from "../types/Types";
import type {
FieldResponseType,
ProductResponeType,
} from "@/pages/product/types/Types";
export const getOrders = async () => {
const { data } = await axios.get<OrderResponseType>(`/admin/orders`);
@@ -32,3 +37,20 @@ export const addTicket = async (ticketId: string, params: AddTicketType) => {
);
return data;
};
export const submitOrder = async (params: CreateFinalOrderType) => {
const { data } = await axios.post(`/admin/orders`, params);
return data;
};
export const getProducts = async () => {
const { data } = await axios.get<ProductResponeType>(`/admin/products`);
return data;
};
export const getAttributes = async (productId?: number) => {
const { data } = await axios.get<FieldResponseType>(
`/admin/entity/${productId}/field`
);
return data;
};