From 91714ce9d2e2b0d3d329b781bf63115885c41c5a Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Mon, 8 Sep 2025 19:34:15 +0000 Subject: [PATCH] Improve how user-submitted financial credits are displayed Remove console logs related to fetching and rendering financial credits and remove the try-catch block around the rendering of individual credits in the Avoirs page. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869/uMhb9Na --- client/src/pages/Avoirs.tsx | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/client/src/pages/Avoirs.tsx b/client/src/pages/Avoirs.tsx index aa8df63..66be6c7 100644 --- a/client/src/pages/Avoirs.tsx +++ b/client/src/pages/Avoirs.tsx @@ -425,20 +425,6 @@ export default function Avoirs() { } }; - // Debug: Log des avoirs reçus - useEffect(() => { - console.log('💰 Debug avoirs reçus:', { - count: avoirs?.length || 0, - first: avoirs?.[0] ? { - id: avoirs[0].id, - keys: Object.keys(avoirs[0]), - hasSupplier: !!avoirs[0].supplier, - hasGroup: !!avoirs[0].group, - hasCreator: !!avoirs[0].creator - } : null - }); - }, [avoirs]); - // 🔍 FONCTION DE VÉRIFICATION DE FACTURE (comme rapprochement) const verifyAvoirInvoiceMutation = useMutation({ mutationFn: async ({ avoirId, invoiceReference, forceRefresh }: { avoirId: number; invoiceReference?: string; forceRefresh?: boolean }) => { @@ -1055,18 +1041,7 @@ export default function Avoirs() { {filteredAvoirs?.filter(avoir => avoir && avoir.id).map((avoir) => { - try { - // Debug: Log de l'avoir pour identifier le problème - console.log('🔍 Render avoir:', { - id: avoir?.id, - hasSupplier: !!avoir?.supplier, - hasGroup: !!avoir?.group, - hasCreator: !!avoir?.creator, - createdAt: avoir?.createdAt, - status: avoir?.status - }); - - const canEditDelete = ['admin', 'directeur'].includes((user as any)?.role); + const canEditDelete = ['admin', 'directeur'].includes((user as any)?.role); return ( @@ -1224,16 +1199,6 @@ export default function Avoirs() { ); - } catch (renderError) { - console.error('❌ Erreur rendu avoir:', renderError, avoir); - return ( - - - Erreur d'affichage de l'avoir #{avoir?.id || 'inconnu'} - - - ); - } })}