From fcd752cda8e4d67e2ab0154b4cac2d553549efe1 Mon Sep 17 00:00:00 2001 From: Carlos Tello Date: Wed, 7 Oct 2026 19:56:25 -0300 Subject: [PATCH] fix(bff): add sheets_inspect route in admin router --- frontend/src/routes/admin.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/frontend/src/routes/admin.js b/frontend/src/routes/admin.js index 1b8688e..e390b35 100644 --- a/frontend/src/routes/admin.js +++ b/frontend/src/routes/admin.js @@ -136,6 +136,24 @@ const handleGoogleSheetsImport = async (req, res, justSynced = false) => { router.get(['/google_sheets_import', '/import'], (req, res) => handleGoogleSheetsImport(req, res, false)); router.post(['/google_sheets_import', '/import'], (req, res) => handleGoogleSheetsImport(req, res, true)); +// Endpoint AJAX para inspeccionar Google Sheets en vivo +router.post('/sheets_inspect', async (req, res) => { + try { + const payload = {}; + if (req.body && req.body.sheets_url) { + payload.sheets_url = req.body.sheets_url; + } + const resp = await req.apiClient.post('/dashboard/sheets-inspect', payload, { timeout: 35000 }); + res.json(resp.data); + } catch (err) { + console.error('Error inspecting sheets in BFF:', err.response?.data || err.message); + res.status(err.response?.status || 500).json({ + status: 'error', + message: err.response?.data?.message || err.message + }); + } +}); + // Guardar configuración del enlace de Google Sheets router.post('/google_sheets_config', async (req, res) => { try {