import { api } from "./client"; import type { Allocation, AllocationInput } from "../types"; export const listAllocations = async (params?: { person_id?: number; project_id?: number; start?: string; end?: string; }) => (await api.get("/allocations", { params })).data; export const createAllocation = async (input: AllocationInput) => (await api.post("/allocations", input)).data; export const updateAllocation = async (id: number, input: Partial) => (await api.patch(`/allocations/${id}`, input)).data; export const deleteAllocation = async (id: number) => (await api.delete<{ deleted: boolean }>(`/allocations/${id}`)).data;