W n8n attention vm
This commit is contained in:
parent
43cbd3e4bc
commit
548dc7fdcf
@ -160,12 +160,34 @@ export async function PUT(request: Request, props: { params: Promise<{ missionId
|
||||
volunteers
|
||||
} = body;
|
||||
|
||||
// Process logo URL to get relative path
|
||||
let logoPath = logo;
|
||||
if (logo && typeof logo === 'string') {
|
||||
try {
|
||||
// If it's a full URL, extract the path
|
||||
if (logo.startsWith('http')) {
|
||||
const url = new URL(logo);
|
||||
logoPath = url.pathname.startsWith('/') ? url.pathname.substring(1) : url.pathname;
|
||||
}
|
||||
// If it's already a relative path, ensure it starts with 'missions/'
|
||||
else if (!logo.startsWith('missions/')) {
|
||||
logoPath = `missions/${logo}`;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error processing logo URL:', {
|
||||
error,
|
||||
logo,
|
||||
missionId
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Update the mission data
|
||||
const updatedMission = await (prisma as any).mission.update({
|
||||
where: { id: missionId },
|
||||
data: {
|
||||
name,
|
||||
logo,
|
||||
logo: logoPath,
|
||||
oddScope: oddScope || undefined,
|
||||
niveau,
|
||||
intention,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user