From 18eee16d2db17d70386b89241da548079408525d Mon Sep 17 00:00:00 2001 From: jubnl Date: Sun, 5 Apr 2026 15:23:29 +0200 Subject: [PATCH] fix(files): prepend /uploads/avatars/ to avatar URL in documents tab Raw avatar filename was passed through formatFile without being transformed into a full URL path, causing the browser to resolve it relative to the current /trips/... page. Closes #417. --- server/src/services/fileService.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/services/fileService.ts b/server/src/services/fileService.ts index 04ed311..288a58d 100644 --- a/server/src/services/fileService.ts +++ b/server/src/services/fileService.ts @@ -42,6 +42,7 @@ export function formatFile(file: TripFile & { trip_id?: number }) { return { ...file, url: `/api/trips/${tripId}/files/${file.id}/download`, + uploaded_by_avatar: file.uploaded_by_avatar ? `/uploads/avatars/${file.uploaded_by_avatar}` : null, }; }