Something went wrong. Try again.
Decorator design pattern demonstration.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334import axiosInstance from "./axiosConfig"
export interface PizzaOrderRequestDto { customerId: string pizzas: string[] address: string}
export interface PizzaOrder { id: string customerId: string pizzas: string[] // You might want to define a more specific type for Pizza if available address: string totalPrice: number orderDate: string}
export const orderService = { async createOrder(request: PizzaOrderRequestDto): Promise<PizzaOrder> { const response = await axiosInstance.post<PizzaOrder>("/order/new", request) return response.data },
async getOrderById(id: string): Promise<PizzaOrder> { const response = await axiosInstance.get<PizzaOrder>(`/order/${id}`) return response.data },
async getAllOrders(): Promise<PizzaOrder[]> { const response = await axiosInstance.get<PizzaOrder[]>("/order/all") return response.data },}