Debug: agregar logging para opciones-filtros
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 46s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 46s
This commit is contained in:
@@ -8,11 +8,16 @@ export default defineEventHandler(async () => {
|
||||
// Get all cards to find the opciones query
|
||||
const allCards = await getMetabaseCards('all')
|
||||
|
||||
// Log available cards for debugging
|
||||
const informeCards = allCards.filter((c: any) => c.name.includes('Informe'))
|
||||
console.log('[API] Available Informe cards:', informeCards.map((c: any) => ({ id: c.id, name: c.name })))
|
||||
|
||||
// Find "Informe Ingresos - Opciones de Filtros" query
|
||||
const card = allCards.find((c: any) => c.name === 'Informe Ingresos - Opciones de Filtros')
|
||||
|
||||
if (!card) {
|
||||
console.warn('[API] Opciones de Filtros query not found, returning empty options')
|
||||
console.warn('[API] Searched for: "Informe Ingresos - Opciones de Filtros"')
|
||||
return {
|
||||
ubicaciones: [],
|
||||
calidades: [],
|
||||
@@ -21,8 +26,16 @@ export default defineEventHandler(async () => {
|
||||
}
|
||||
}
|
||||
|
||||
console.log('[API] Found Opciones de Filtros card:', card.id, card.name)
|
||||
|
||||
// Execute the query (no parameters needed)
|
||||
const result = await executeCardQuery(card.id, [])
|
||||
console.log('[API] Query result:', {
|
||||
hasData: !!result.data,
|
||||
rows: result.data?.rows?.length,
|
||||
cols: result.data?.cols?.length,
|
||||
firstRow: result.data?.rows?.[0]
|
||||
})
|
||||
|
||||
if (!result.data?.rows?.[0] || !result.data?.cols) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user