Create order in admin
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user