Revert "V1_GTA"

This reverts commit 881476122c.
This commit is contained in:
2025-12-02 17:50:31 +01:00
parent 0dc7125688
commit 6f75a66906
54 changed files with 5645 additions and 7619 deletions

View File

@@ -1,38 +0,0 @@
// hooks/useSSENotifications.js
import { useEffect, useCallback } from 'react';
export const useSSENotifications = (token, collaborateurId, onEventReceived) => {
useEffect(() => {
if (!token || !collaborateurId) return;
const eventSource = new EventSource(
`/api/events?token=${encodeURIComponent(token)}`
);
eventSource.onmessage = (event) => {
try {
const data = JSON.parse(event.data);
console.log('📨 SSE reçu:', data);
// Log spécifique pour les récupérations
if (data.type === 'demande-validated' && data.typeConge === 'Récupération') {
console.log('🎨 Couleur reçue:', data.couleurHex);
}
onEventReceived(data);
} catch (error) {
console.error('❌ Erreur parsing SSE:', error);
}
};
eventSource.onerror = (error) => {
console.error('❌ Erreur SSE:', error);
eventSource.close();
};
return () => {
eventSource.close();
};
}, [token, collaborateurId, onEventReceived]);
};