From e803d3b16a1d7d44391f2fe87beb743de95225bf Mon Sep 17 00:00:00 2001 From: josedario87 Date: Mon, 9 Jun 2025 17:43:17 -0600 Subject: [PATCH] logs para debugear realtime --- ui/src/stores/useRealtime.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui/src/stores/useRealtime.js b/ui/src/stores/useRealtime.js index 83f5a1e..a567cdf 100644 --- a/ui/src/stores/useRealtime.js +++ b/ui/src/stores/useRealtime.js @@ -19,9 +19,14 @@ export const useRealtimeStore = defineStore('realtime', { console.log('🟢 Conexión SSE establecida correctamente'); }; - this._sse.onmessage = (e) => { - try { - const payload = JSON.parse(e.data); + this._sse.onmessage = (e) => { + console.log('📩 SSE message raw:', e.data); + + try { + const payload = JSON.parse(e.data); + console.log('📦 Payload parseado:', payload); + console.log('🧪 Tabla recibida:', payload.table); + switch (payload.table) { case 'Planilla': usePlanillasStore().fetchPlanillas();