W n8n attention
This commit is contained in:
parent
7b6401cc6f
commit
d1205215f8
@ -84,6 +84,7 @@ export async function GET(request: Request, props: { params: Promise<{ missionId
|
|||||||
const missionWithUrls = {
|
const missionWithUrls = {
|
||||||
...mission,
|
...mission,
|
||||||
logoUrl: mission.logo ? `/api/missions/image/${mission.logo}` : null,
|
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 }) => ({
|
attachments: mission.attachments.map((attachment: { id: string; filename: string; filePath: string; fileType: string; fileSize: number; createdAt: Date }) => ({
|
||||||
...attachment,
|
...attachment,
|
||||||
publicUrl: `/api/missions/image/${attachment.filePath}`
|
publicUrl: `/api/missions/image/${attachment.filePath}`
|
||||||
|
|||||||
@ -148,7 +148,7 @@ export async function POST(request: Request) {
|
|||||||
console.log('Logo uploaded successfully to path:', filePath);
|
console.log('Logo uploaded successfully to path:', filePath);
|
||||||
|
|
||||||
// Generate public URL
|
// Generate public URL
|
||||||
const publicUrl = getPublicUrl(filePath, S3_CONFIG.bucket);
|
const publicUrl = `/api/missions/image/${filePath}`;
|
||||||
console.log('Public URL for logo:', publicUrl);
|
console.log('Public URL for logo:', publicUrl);
|
||||||
|
|
||||||
// Update mission record with logo path
|
// Update mission record with logo path
|
||||||
|
|||||||
@ -8,8 +8,8 @@ import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
|
|||||||
|
|
||||||
// Generate the mission logo path in Minio
|
// Generate the mission logo path in Minio
|
||||||
export function getMissionLogoPath(userId: string, missionId: string, fileExtension: string): string {
|
export function getMissionLogoPath(userId: string, missionId: string, fileExtension: string): string {
|
||||||
// Simplify path to match pages bucket structure
|
// Use a consistent path structure: missions/{missionId}/logo{extension}
|
||||||
return `${missionId}/logo${fileExtension}`;
|
return `missions/${missionId}/logo${fileExtension}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate the mission attachment path in Minio
|
// Generate the mission attachment path in Minio
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user