feat(aep): carte AEP — push Gitea 2026-04-28

This commit is contained in:
Jules Neny
2026-04-28 14:00:05 +02:00
commit 21c44d8193
86 changed files with 31855 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
/**
* GET /api/fiche/[id]
* Proxy NocoDB — retourne la fiche complète avec tous les champs V2.
* Utilisé par pages/fiche/[id].vue (SSR).
*/
export default defineEventHandler(async (event) => {
const config = useRuntimeConfig()
const id = getRouterParam(event, 'id')
if (!id || isNaN(Number(id))) {
throw createError({ statusCode: 400, message: 'Identifiant invalide' })
}
const url = `${config.nocodbUrl}/api/v2/tables/${config.orgTableId}/records?where=(Id,eq,${id})&limit=1`
const data: any = await $fetch(url, {
headers: { 'xc-token': config.nocodbToken },
}).catch(() => null)
const record = data?.list?.[0] ?? null
if (!record) {
throw createError({ statusCode: 404, message: 'Organisation non trouvée' })
}
return record
})