feat(frontend): Suche und Filter (Modul 14)
/search-Seite über Bienenstände, Völker, Königinnen, Aufgaben und Honigchargen. Filterleisten (Status/Standort) in den Listen-Views für Bienenstände, Völker, Königinnen und Honigchargen.
This commit is contained in:
1 parent
146b56d683
commit
166979ff3c
21 files changed
+314
-28
No files matched your search
@@ -3,11 +3,19 @@ import {
|
||||
CreateHoneyBatchInput,
|
||||
CreateHoneyMeasurementInput,
|
||||
HoneyBatch,
|
||||
HoneyBatchStatus,
|
||||
Traceability,
|
||||
} from "./types";
|
||||
|
||||
export function fetchHoneyBatches(): Promise<HoneyBatch[]> {
|
||||
return apiFetch<HoneyBatch[]>("/honey-batches");
|
||||
export interface HoneyBatchFilter {
|
||||
status?: HoneyBatchStatus;
|
||||
}
|
||||
|
||||
export function fetchHoneyBatches(filter: HoneyBatchFilter = {}): Promise<HoneyBatch[]> {
|
||||
const params = new URLSearchParams();
|
||||
if (filter.status) params.set("status", filter.status);
|
||||
const query = params.toString();
|
||||
return apiFetch<HoneyBatch[]>(`/honey-batches${query ? `?${query}` : ""}`);
|
||||
}
|
||||
|
||||
export function fetchHoneyBatch(id: string): Promise<HoneyBatch> {
|
||||
|
||||
Reference in new issue
Block a user