Improve task management by handling date errors and ensuring data integrity

Implement robust error handling and data validation for task dates and properties in both frontend and backend to resolve production issues.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cc2d271b-82f0-4d6a-9302-a0b067ffb429
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/cc2d271b-82f0-4d6a-9302-a0b067ffb429/0taewQN
This commit is contained in:
michaelschal committed 2025-08-19 07:39:33 +00:00
1 parent aa1906a9bb
commit 0d863da97e
7 files changed
+765 -56

No files matched your search

+3 -2
View File
@@ -66,13 +66,14 @@ export default function NewTaskForm({ task, onClose }: NewTaskFormProps) {
// Récupération des magasins pour l'auto-sélection
const { data: groupsData = [] } = useQuery<Group[]>({
queryKey: ['/api/groups'],
enabled: !!user, // Seulement si l'utilisateur est connecté
});
// Filtrer les groupes selon le magasin sélectionné pour les admins
const groups = Array.isArray(groupsData) ? (
user?.role === 'admin' && selectedStoreId
? groupsData.filter(g => g.id === selectedStoreId)
: groupsData
? groupsData.filter(g => g && g.id === selectedStoreId)
: groupsData.filter(g => g)
) : [];
// Auto-sélectionner le magasin selon les règles