W n8n attention

This commit is contained in:
alma 2025-05-24 10:27:31 +02:00
parent 7b6401cc6f
commit d1205215f8
3 changed files with 4 additions and 3 deletions

View File

@ -84,6 +84,7 @@ export async function GET(request: Request, props: { params: Promise<{ missionId
const missionWithUrls = {
...mission,
logoUrl: mission.logo ? `/api/missions/image/${mission.logo}` : null,
logo: mission.logo,
attachments: mission.attachments.map((attachment: { id: string; filename: string; filePath: string; fileType: string; fileSize: number; createdAt: Date }) => ({
...attachment,
publicUrl: `/api/missions/image/${attachment.filePath}`

View File

@ -148,7 +148,7 @@ export async function POST(request: Request) {
console.log('Logo uploaded successfully to path:', filePath);
// Generate public URL
const publicUrl = getPublicUrl(filePath, S3_CONFIG.bucket);
const publicUrl = `/api/missions/image/${filePath}`;
console.log('Public URL for logo:', publicUrl);
// Update mission record with logo path

View File

@ -8,8 +8,8 @@ import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
// Generate the mission logo path in Minio
export function getMissionLogoPath(userId: string, missionId: string, fileExtension: string): string {
// Simplify path to match pages bucket structure
return `${missionId}/logo${fileExtension}`;
// Use a consistent path structure: missions/{missionId}/logo{extension}
return `missions/${missionId}/logo${fileExtension}`;
}
// Generate the mission attachment path in Minio