import type { FactoryListRes, OrderCreateReq, OrderList, ProductListRes, } from "@/features/specification/lib/data"; import httpClient from "@/shared/config/api/httpClient"; import { FACTORY, ORDER, PRODUCT } from "@/shared/config/api/URLs"; import type { AxiosResponse } from "axios"; export const order_api = { async factory_list(): Promise> { const res = await httpClient.get(FACTORY); return res; }, async product_list(): Promise> { const res = await httpClient.get(PRODUCT); return res; }, async order_list(): Promise> { const res = await httpClient.get(`${ORDER}list/`); return res; }, async order_create(body: OrderCreateReq) { const res = await httpClient.post(`${ORDER}create/`, body); return res; }, async update({ body, id }: { id: number; body: { paid_price: number } }) { const res = await httpClient.patch(`${ORDER}${id}/update/`, body); return res; }, };