diff --git a/app/api/missions/image/[...path]/route.ts b/app/api/missions/image/[...path]/route.ts index aea345dd..598d42db 100644 --- a/app/api/missions/image/[...path]/route.ts +++ b/app/api/missions/image/[...path]/route.ts @@ -18,16 +18,19 @@ const s3Client = new S3Client({ // This endpoint serves mission images from Minio using the server's credentials export async function GET( request: NextRequest, - context: { params: { path: string[] } } + { params }: { params: Promise<{ path: string[] }> } ) { try { + // Await the params promise to get the actual path parameter + const { path } = await params + // Check if path is provided - if (!context.params.path || context.params.path.length === 0) { + if (!path || path.length === 0) { return new NextResponse('Path is required', { status: 400 }); } // Reconstruct the full path from path segments - const filePath = context.params.path.join('/'); + const filePath = path.join('/'); console.log('Fetching mission image:', filePath); // Create S3 command to get the object