Initial Nuxt data explorer setup

This commit is contained in:
2025-09-29 14:10:11 -06:00
commit 47f4a20bd3
35 changed files with 13509 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import { parseQuerySegment } from '../../../services/query-parser'
import { fetchTableData } from '../../../services/table-service'
export default defineEventHandler(async (event) => {
const table = event.context.params?.table
if (!table) {
throw createError({ statusCode: 400, statusMessage: 'Tabla no especificada' })
}
const query = getQuery(event)
const limitValue = Number.parseInt((query.limit as string) ?? '', 10)
const limit = Number.isFinite(limitValue) ? Math.min(Math.max(limitValue, 1), 500) : undefined
const parsedQuery = parseQuerySegment(query.query as string | undefined)
return await fetchTableData(table, {
parsedQuery,
limit,
filters: {
id: (query.id as string) || undefined,
createdFrom: (query.created_from as string) || undefined,
createdTo: (query.created_to as string) || undefined
}
})
})