Mobile-optimiertes Erfassungsformular unter /treatments/new sowie "Behandlungen"-Ansicht auf der Volk-Detailseite.
14 lines
451 B
TypeScript
14 lines
451 B
TypeScript
import { apiFetch } from "@/lib/auth/api-client";
|
|
import { CreateTreatmentInput, Treatment } from "./types";
|
|
|
|
export function fetchColonyTreatments(colonyId: string): Promise<Treatment[]> {
|
|
return apiFetch<Treatment[]>(`/colonies/${colonyId}/treatments`);
|
|
}
|
|
|
|
export function createTreatment(input: CreateTreatmentInput): Promise<Treatment> {
|
|
return apiFetch<Treatment>("/treatments", {
|
|
method: "POST",
|
|
body: JSON.stringify(input),
|
|
});
|
|
}
|