feat(frontend): Honigchargen-Ansichten (Modul 11)
Chargenliste mit Anlage-Dialog sowie Detailseite mit Honigmessungen und Rückverfolgbarkeits-Ansicht bis zu den Ursprungsvölkern.
This commit is contained in:
1 parent
cf625552d1
commit
f3d99524ff
8 files changed
+525
-1
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import { apiFetch } from "@/lib/auth/api-client";
|
||||
import {
|
||||
CreateHoneyBatchInput,
|
||||
CreateHoneyMeasurementInput,
|
||||
HoneyBatch,
|
||||
Traceability,
|
||||
} from "./types";
|
||||
|
||||
export function fetchHoneyBatches(): Promise<HoneyBatch[]> {
|
||||
return apiFetch<HoneyBatch[]>("/honey-batches");
|
||||
}
|
||||
|
||||
export function fetchHoneyBatch(id: string): Promise<HoneyBatch> {
|
||||
return apiFetch<HoneyBatch>(`/honey-batches/${id}`);
|
||||
}
|
||||
|
||||
export function fetchHoneyBatchTraceability(id: string): Promise<Traceability> {
|
||||
return apiFetch<Traceability>(`/honey-batches/${id}/traceability`);
|
||||
}
|
||||
|
||||
export function createHoneyBatch(input: CreateHoneyBatchInput): Promise<HoneyBatch> {
|
||||
return apiFetch<HoneyBatch>("/honey-batches", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(input),
|
||||
});
|
||||
}
|
||||
|
||||
export function addHoneyMeasurement(
|
||||
id: string,
|
||||
input: CreateHoneyMeasurementInput,
|
||||
): Promise<HoneyBatch> {
|
||||
return apiFetch<HoneyBatch>(`/honey-batches/${id}/measurements`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(input),
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user