Files
nav-carte/server/routes/api/avis/[orgId].get.ts
2026-04-28 14:00:05 +02:00

14 lines
395 B
TypeScript

export default defineEventHandler(async (event) => {
const config = useRuntimeConfig()
const orgId = getRouterParam(event, 'orgId')
const url = `${config.nocodbUrl}/api/v2/tables/${config.avisTableId}/records?where=(organisation_id,eq,${orgId})~and(status,eq,approved)`
const data = await $fetch(url, {
headers: {
'xc-token': config.nocodbToken,
},
})
return data
})