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.
This commit is contained in:
jubnl
2026-04-05 15:23:29 +02:00
parent 7821993450
commit 18eee16d2d

View File

@@ -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,
};
}