Fix : Mise a jour et création d'un événement
This commit is contained in:
@@ -395,8 +395,14 @@ class EventFormController extends ChangeNotifier {
|
||||
);
|
||||
|
||||
final eventId = await EventFormService.createEvent(newEvent);
|
||||
final newFiles = await EventFormService.moveFilesToEvent(_uploadedFiles, eventId);
|
||||
await EventFormService.updateEventDocuments(eventId, newFiles);
|
||||
|
||||
// Déplacer et mettre à jour les fichiers uniquement s'il y en a
|
||||
if (_uploadedFiles.isNotEmpty) {
|
||||
final newFiles = await EventFormService.moveFilesToEvent(_uploadedFiles, eventId);
|
||||
if (newFiles.isNotEmpty) {
|
||||
await EventFormService.updateEventDocuments(eventId, newFiles);
|
||||
}
|
||||
}
|
||||
|
||||
// Reload events
|
||||
final localUserProvider = Provider.of<LocalUserProvider>(context, listen: false);
|
||||
|
||||
Reference in New Issue
Block a user