W n8n rest
This commit is contained in:
parent
89788e409e
commit
8739fb5de0
@ -378,18 +378,7 @@ export function MissionsAdminPanel() {
|
|||||||
|
|
||||||
// Handle mission submission
|
// Handle mission submission
|
||||||
const handleSubmitMission = async () => {
|
const handleSubmitMission = async () => {
|
||||||
console.log('Starting mission submission...');
|
|
||||||
console.log('Current mission data:', JSON.stringify(missionData, null, 2));
|
|
||||||
console.log('Selected services:', selectedServices);
|
|
||||||
console.log('Guardians:', {
|
|
||||||
gardienDuTemps,
|
|
||||||
gardienDeLaParole,
|
|
||||||
gardienDeLaMemoire
|
|
||||||
});
|
|
||||||
console.log('Volunteers:', volontaires);
|
|
||||||
|
|
||||||
if (!validateMission()) {
|
if (!validateMission()) {
|
||||||
console.log('Mission validation failed');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,8 +402,10 @@ export function MissionsAdminPanel() {
|
|||||||
'gardien-memoire': gardienDeLaMemoire
|
'gardien-memoire': gardienDeLaMemoire
|
||||||
},
|
},
|
||||||
volunteers: volontaires,
|
volunteers: volontaires,
|
||||||
logo: selectedLogoFile,
|
// Only include logo if it exists and has a path
|
||||||
attachments: selectedAttachments
|
logo: missionData.logo || null,
|
||||||
|
// Don't send attachments directly - they should be handled separately
|
||||||
|
attachments: undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log('Submitting mission data:', JSON.stringify(formattedData, null, 2));
|
console.log('Submitting mission data:', JSON.stringify(formattedData, null, 2));
|
||||||
@ -427,13 +418,21 @@ export function MissionsAdminPanel() {
|
|||||||
body: JSON.stringify(formattedData),
|
body: JSON.stringify(formattedData),
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('Response status:', response.status);
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
console.log('Response data:', JSON.stringify(data, null, 2));
|
console.log('Response status:', response.status);
|
||||||
|
console.log('Response data:', data);
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
console.error('Error response:', data);
|
throw new Error(data.error || data.details || 'Failed to create mission');
|
||||||
throw new Error(data.error || 'Failed to create mission');
|
}
|
||||||
|
|
||||||
|
// Handle file uploads after mission creation if needed
|
||||||
|
if (selectedLogoFile || selectedAttachments.length > 0) {
|
||||||
|
// TODO: Implement file upload handling
|
||||||
|
console.log('Files to be uploaded:', {
|
||||||
|
logo: selectedLogoFile,
|
||||||
|
attachments: selectedAttachments
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user