Fix: corregir tipos de parámetros en queries de Metabase
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 47s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 47s
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'"
This commit is contained in:
@@ -324,7 +324,7 @@ async function executeQuery() {
|
|||||||
// Build parameters from current form values
|
// Build parameters from current form values
|
||||||
for (const [tagName, tagConfig] of Object.entries(templateTags.value)) {
|
for (const [tagName, tagConfig] of Object.entries(templateTags.value)) {
|
||||||
const config = tagConfig as any
|
const config = tagConfig as any
|
||||||
let paramType = 'text'
|
let paramType = 'string/='
|
||||||
let paramValue = parameterValues.value[tagName]
|
let paramValue = parameterValues.value[tagName]
|
||||||
|
|
||||||
// Determine parameter type based on tag type
|
// Determine parameter type based on tag type
|
||||||
@@ -332,12 +332,14 @@ async function executeQuery() {
|
|||||||
paramType = 'date/single'
|
paramType = 'date/single'
|
||||||
paramValue = parameterValues.value[tagName] || null
|
paramValue = parameterValues.value[tagName] || null
|
||||||
} else if (config.type === 'boolean') {
|
} else if (config.type === 'boolean') {
|
||||||
paramType = 'boolean'
|
paramType = 'boolean/='
|
||||||
paramValue = parameterValues.value[tagName]
|
paramValue = parameterValues.value[tagName]
|
||||||
} else if (config.type === 'text' && (tagName.toLowerCase().includes('fecha') || config?.['display-name']?.toLowerCase().includes('fecha'))) {
|
} else if (config.type === 'number') {
|
||||||
// Si es tipo text pero parece una fecha, enviar como text
|
paramType = 'number/='
|
||||||
paramType = 'text'
|
paramValue = parameterValues.value[tagName] || null
|
||||||
paramValue = parameterValues.value[tagName] || ''
|
} else if (config.type === 'text') {
|
||||||
|
paramType = 'string/='
|
||||||
|
paramValue = parameterValues.value[tagName] || null
|
||||||
}
|
}
|
||||||
|
|
||||||
parameters.push({
|
parameters.push({
|
||||||
|
|||||||
Reference in New Issue
Block a user