Files
nav-carte/server/routes/api/organisations.post.ts
2026-04-28 14:00:05 +02:00

17 lines
418 B
TypeScript

export default defineEventHandler(async (event) => {
const config = useRuntimeConfig()
const body = await readBody(event)
const url = `${config.nocodbUrl}/api/v2/tables/${config.orgTableId}/records`
const data = await $fetch(url, {
method: 'POST',
headers: {
'xc-token': config.nocodbToken,
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
})
return data
})