feat(aep): carte AEP — push Gitea 2026-04-28
This commit is contained in:
17
server/routes/api/organisations/[id].get.ts
Normal file
17
server/routes/api/organisations/[id].get.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export default defineEventHandler(async (event) => {
|
||||
const config = useRuntimeConfig()
|
||||
const id = getRouterParam(event, 'id')
|
||||
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,
|
||||
},
|
||||
})
|
||||
|
||||
const record = data?.list?.[0] ?? null
|
||||
if (!record) {
|
||||
throw createError({ statusCode: 404, message: 'Organisation non trouvée' })
|
||||
}
|
||||
return record
|
||||
})
|
||||
Reference in New Issue
Block a user