From 025040289be8ce4afc4b00051e89496860c98fa5 Mon Sep 17 00:00:00 2001 From: alma Date: Tue, 6 May 2025 22:09:15 +0200 Subject: [PATCH] observatoire --- app/api/missions/image/[...path]/route.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/api/missions/image/[...path]/route.ts b/app/api/missions/image/[...path]/route.ts index 21dc71a5..aea345dd 100644 --- a/app/api/missions/image/[...path]/route.ts +++ b/app/api/missions/image/[...path]/route.ts @@ -16,15 +16,18 @@ const s3Client = new S3Client({ }); // This endpoint serves mission images from Minio using the server's credentials -export async function GET(request: NextRequest, { params }: { params: { path: string[] } }) { +export async function GET( + request: NextRequest, + context: { params: { path: string[] } } +) { try { // Check if path is provided - if (!params.path || params.path.length === 0) { + if (!context.params.path || context.params.path.length === 0) { return new NextResponse('Path is required', { status: 400 }); } // Reconstruct the full path from path segments - const filePath = params.path.join('/'); + const filePath = context.params.path.join('/'); console.log('Fetching mission image:', filePath); // Create S3 command to get the object