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:
@@ -42,6 +42,7 @@ export function formatFile(file: TripFile & { trip_id?: number }) {
|
|||||||
return {
|
return {
|
||||||
...file,
|
...file,
|
||||||
url: `/api/trips/${tripId}/files/${file.id}/download`,
|
url: `/api/trips/${tripId}/files/${file.id}/download`,
|
||||||
|
uploaded_by_avatar: file.uploaded_by_avatar ? `/uploads/avatars/${file.uploaded_by_avatar}` : null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user