From c389b38cf56e204eba739676aa7b357bbf7af46c Mon Sep 17 00:00:00 2001 From: "theis.gaedigk" Date: Tue, 19 Aug 2025 21:24:41 +0200 Subject: [PATCH] added new log column "take_date" Also removed unnesesarry code notes --- frontend/src/components/Form2.tsx | 3 --- frontend/src/components/Form4.tsx | 7 +++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/Form2.tsx b/frontend/src/components/Form2.tsx index 0ef689b..65d7cfe 100644 --- a/frontend/src/components/Form2.tsx +++ b/frontend/src/components/Form2.tsx @@ -13,14 +13,12 @@ interface BorrowItem { const LOCAL_STORAGE_KEY = "borrowableItems"; -// Einfache Type-Guard/Validierung const isBorrowItem = (v: any): v is BorrowItem => v && typeof v.id === "number" && (typeof v.item_name === "string" || typeof v.name === "string") && (typeof v.can_borrow_role === "string" || typeof v.role === "string"); -// Helfer: unterschiedliche Server-Shapes normalisieren function normalizeBorrowable(data: any): BorrowItem[] { const rawArr = Array.isArray(data) ? data @@ -52,7 +50,6 @@ function normalizeBorrowable(data: any): BorrowItem[] { .filter(Boolean) as BorrowItem[]; } -// Hook, der automatisch aus dem Local Storage liest und auf Änderungen hört function useBorrowableItems() { const [items, setItems] = React.useState([]); diff --git a/frontend/src/components/Form4.tsx b/frontend/src/components/Form4.tsx index afcd3db..1f452ac 100644 --- a/frontend/src/components/Form4.tsx +++ b/frontend/src/components/Form4.tsx @@ -8,6 +8,7 @@ type Loan = { loan_code: number; start_date: string; end_date: string; + take_date: string | null; returned_date: string | null; created_at: string; loaned_items_id: number[]; @@ -89,6 +90,9 @@ const Form4: React.FC = () => { Ende + + Abgeholt + Zurückgegeben @@ -118,6 +122,9 @@ const Form4: React.FC = () => { {formatDate(loan.end_date)} + + {formatDate(loan.take_date)} + {formatDate(loan.returned_date)}