Spaces:
Running
Running
| 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<Allocation[]>("/allocations", { params })).data; | |
| export const createAllocation = async (input: AllocationInput) => | |
| (await api.post<Allocation>("/allocations", input)).data; | |
| export const updateAllocation = async (id: number, input: Partial<AllocationInput>) => | |
| (await api.patch<Allocation>(`/allocations/${id}`, input)).data; | |
| export const deleteAllocation = async (id: number) => | |
| (await api.delete<{ deleted: boolean }>(`/allocations/${id}`)).data; | |