17 lines
418 B
TypeScript
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
|
|
})
|