22 lines
634 B
TypeScript
22 lines
634 B
TypeScript
import type { DistributedList } from "@/features/distributed/lib/data";
|
|
import httpClient from "@/shared/config/api/httpClient";
|
|
import { DISTRIBUTED_CREATE, DISTRIBUTED_LIST } from "@/shared/config/api/URLs";
|
|
import type { AxiosResponse } from "axios";
|
|
|
|
export const distributed_api = {
|
|
async list(): Promise<AxiosResponse<DistributedList>> {
|
|
const res = await httpClient.get(DISTRIBUTED_LIST);
|
|
return res;
|
|
},
|
|
|
|
async create(body: {
|
|
product_id: number;
|
|
date: string;
|
|
employee_name: string;
|
|
quantity: number;
|
|
}) {
|
|
const res = await httpClient.post(DISTRIBUTED_CREATE, body);
|
|
return res;
|
|
},
|
|
};
|