From fb283765fba5287065487ce70d60ca30eacdb306 Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 21 Aug 2026 01:13:44 +0200 Subject: [PATCH] fix(repair-details): update file handling and type definitions - Modified the file handling in the repair details page to use the correct repair ID and simplified the key assignment for photo files. - Updated the API route to cast the status parameter to the new RepairStatus type for improved type safety. - Expanded the RepairFileField type to include "delivery_note" for better file management. - Removed unused helper functions to clean up the codebase and improve maintainability. --- src/app/(app)/repairs/[id]/page.tsx | 6 +++--- src/app/api/v1/repairs/route.ts | 3 ++- src/lib/server/repairs-service.ts | 16 +--------------- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/app/(app)/repairs/[id]/page.tsx b/src/app/(app)/repairs/[id]/page.tsx index e79b869..3843c9c 100644 --- a/src/app/(app)/repairs/[id]/page.tsx +++ b/src/app/(app)/repairs/[id]/page.tsx @@ -547,12 +547,12 @@ export default function RepairDetailPage({
{photoFiles.map((f) => ( e.stopPropagation()} > { - const pb = await getAdminPocketBase(); - try { - const me = await pb.collection(USERS).getAuthRecord(); - return me ? { id: (me as User).id, name: (me as User).name } : null; - } catch { - return null; - } -}