import { fetchTableRecordMetadata } from '../../../services/table-service'

export default defineEventHandler(async (event) => {
  const table = event.context.params?.table
  const id = event.context.params?.id

  if (!table || !id) {
    throw createError({ statusCode: 400, statusMessage: 'Tabla o id no especificados' })
  }

  return await fetchTableRecordMetadata(table, id)
})
