From 76eaa5fd6a13edcffc92d35ee34827237cc6a0c7 Mon Sep 17 00:00:00 2001 From: josedario87 Date: Wed, 29 Oct 2025 17:30:12 -0600 Subject: [PATCH] =?UTF-8?q?Fix:=20corregir=20tipos=20de=20par=C3=A1metros?= =?UTF-8?q?=20en=20queries=20de=20Metabase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problema: - Las queries de Metabase fallaban con error 500 al ejecutarse desde metabase-debug - Metabase rechazaba los parámetros porque usaban tipos simples en lugar de tipos con operadores Solución: - Actualizar mapeo de tipos de parámetros en MetabaseCardDisplay.vue - boolean → boolean/= - date → date/single - number → number/= - text → string/= Esto corrige el error "Tipo de parámetro no válido :text para el parámetro 'cliente_ids'" --- .../components/metabase/MetabaseCardDisplay.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/nuxt4-app/app/components/metabase/MetabaseCardDisplay.vue b/nuxt4-app/app/components/metabase/MetabaseCardDisplay.vue index 96c5cec..def91a2 100644 --- a/nuxt4-app/app/components/metabase/MetabaseCardDisplay.vue +++ b/nuxt4-app/app/components/metabase/MetabaseCardDisplay.vue @@ -324,7 +324,7 @@ async function executeQuery() { // Build parameters from current form values for (const [tagName, tagConfig] of Object.entries(templateTags.value)) { const config = tagConfig as any - let paramType = 'text' + let paramType = 'string/=' let paramValue = parameterValues.value[tagName] // Determine parameter type based on tag type @@ -332,12 +332,14 @@ async function executeQuery() { paramType = 'date/single' paramValue = parameterValues.value[tagName] || null } else if (config.type === 'boolean') { - paramType = 'boolean' + paramType = 'boolean/=' paramValue = parameterValues.value[tagName] - } else if (config.type === 'text' && (tagName.toLowerCase().includes('fecha') || config?.['display-name']?.toLowerCase().includes('fecha'))) { - // Si es tipo text pero parece una fecha, enviar como text - paramType = 'text' - paramValue = parameterValues.value[tagName] || '' + } else if (config.type === 'number') { + paramType = 'number/=' + paramValue = parameterValues.value[tagName] || null + } else if (config.type === 'text') { + paramType = 'string/=' + paramValue = parameterValues.value[tagName] || null } parameters.push({