diff --git a/attached_assets/{8B6C5975-064E-4FE4-A8C3-3176DFB1BEBE}_1756805383966.png b/attached_assets/{8B6C5975-064E-4FE4-A8C3-3176DFB1BEBE}_1756805383966.png new file mode 100644 index 0000000..ca699ac Binary files /dev/null and b/attached_assets/{8B6C5975-064E-4FE4-A8C3-3176DFB1BEBE}_1756805383966.png differ diff --git a/client/src/pages/Tasks.tsx b/client/src/pages/Tasks.tsx index 72a38e3..3ca3783 100644 --- a/client/src/pages/Tasks.tsx +++ b/client/src/pages/Tasks.tsx @@ -87,7 +87,13 @@ function TaskFormInline({ task, onClose, selectedStoreId, user }: any) { (taskData as any).createdBy = user?.username || 'admin'; } - console.log('📤 Sending request:', { url, method, taskData }); + console.log('📤 Tasks.tsx - Sending request:', { + url, + method, + taskData, + selectedStoreId, + finalGroupId: taskData.groupId + }); const response = await fetch(url, { method, diff --git a/client/src/pages/TasksSimplified.tsx b/client/src/pages/TasksSimplified.tsx index 9f08d1c..0f1728e 100644 --- a/client/src/pages/TasksSimplified.tsx +++ b/client/src/pages/TasksSimplified.tsx @@ -80,11 +80,20 @@ export default function TasksSimplified() { // Création d'une tâche const handleCreateTask = async (taskData: any) => { try { - await apiRequest('/api/tasks', 'POST', { + const finalData = { ...taskData, groupId: selectedStoreId ? parseInt(selectedStoreId) : stores[0]?.id + }; + + console.log('🔍 TasksSimplified - Creating task with data:', { + selectedStoreId, + storesLength: stores.length, + finalGroupId: finalData.groupId, + taskData: finalData }); + await apiRequest('/api/tasks', 'POST', finalData); + queryClient.invalidateQueries({ queryKey: ["/api/tasks"] }); setShowCreateModal(false); toast({ @@ -92,6 +101,7 @@ export default function TasksSimplified() { description: "Tâche créée avec succès", }); } catch (error) { + console.error('❌ TasksSimplified - Error creating task:', error); toast({ title: "Erreur", description: "Impossible de créer la tâche",