mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Improve task creation logging and group assignment clarity
Add detailed logging for task creation, including selected group ID in TasksSimplified.tsx and Tasks.tsx, and ensure correct groupId is sent in the API request. Replit-Commit-Author: Agent Replit-Commit-Session-Id: f2b9c241-9fdd-4abd-9041-720afc8b27d6 Replit-Commit-Checkpoint-Type: full_checkpoint
This commit is contained in:
1 parent
54aa499edd
commit
db66792e8b
3 files changed
+18
-2
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 244 KiB |
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user