15 lines
474 B
TypeScript
15 lines
474 B
TypeScript
import { apiClient } from '@services';
|
|
import { Order, OrderRequest, PlaceOrderResponse } from '@interfaces';
|
|
|
|
export const placeOrderApi = async (payload: OrderRequest) => {
|
|
return await apiClient.post<PlaceOrderResponse>('/orders', payload);
|
|
};
|
|
|
|
export const getOrderHistoryApi = async () => {
|
|
return await apiClient.get<Order[]>('/orders');
|
|
};
|
|
|
|
export const getOrderByIdApi = async (orderId: string) => {
|
|
return await apiClient.get<Order>(`/orders/${orderId}`);
|
|
};
|