From 094276d3cc7117eee30e4bcbce487e54f0eacb29 Mon Sep 17 00:00:00 2001 From: Paul Nothaft Date: Mon, 13 Apr 2026 07:30:08 +0200 Subject: [PATCH] fix: revert /api prefix in adminPhotos.js to avoid double-prefix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AdminPhotoGrid uses AdminAuthenticatedImage which fetches via Axios (baseURL: /api), so the backend URL must not include /api — Axios adds it. The adminGuests.js /api prefix is correct because its consumer (AuthenticatedImage) uses fetch() with buildResourceUrl(). --- backend/src/routes/adminPhotos.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/routes/adminPhotos.js b/backend/src/routes/adminPhotos.js index d422f067..bcd98076 100644 --- a/backend/src/routes/adminPhotos.js +++ b/backend/src/routes/adminPhotos.js @@ -922,9 +922,9 @@ router.get('/:eventId/photos', adminAuth, requirePermission('photos.view'), requ filename: photo.filename, original_filename: photo.original_filename || null, // Use the correct admin photos router base for serving images - url: `/api/admin/photos/${eventId}/photo/${photo.id}`, + url: `/admin/photos/${eventId}/photo/${photo.id}`, // Always expose a thumbnail URL; backend will generate on demand if missing - thumbnail_url: `/api/admin/photos/${eventId}/thumbnail/${photo.id}`, + thumbnail_url: `/admin/photos/${eventId}/thumbnail/${photo.id}`, type: photo.type, category_id: photo.category_id || photo.type, category_name: photo.pc_name || (photo.type === 'individual' ? 'Individual Photos' : 'Collages'),