Unverified Commit 768183c5 authored by Lee Robinson's avatar Lee Robinson Committed by GitHub

docs: update API example (#76987)

Make it clear this is not a real function
parent 76db2ead
...@@ -34,8 +34,10 @@ export default async function handler( ...@@ -34,8 +34,10 @@ export default async function handler(
```js filename="pages/api/submit.js" switcher ```js filename="pages/api/submit.js" switcher
export default function handler(req, res) { export default function handler(req, res) {
const data = req.body const data = req.body
const id = await createItem(data) // call your database, etc.
res.status(200).json({ id }) // const id = await createItem(data)
// ...
res.status(200).json({ data })
} }
``` ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment