Skip to content

Commit 768183c

Browse files
authored
docs: update API example (#76987)
Make it clear this is not a real function
1 parent 76db2ea commit 768183c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/02-pages/02-building-your-application/03-data-fetching/03-forms-and-mutations.mdx

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ export default async function handler(
3434
```js filename="pages/api/submit.js" switcher
3535
export default function handler(req, res) {
3636
const data = req.body
37-
const id = await createItem(data)
38-
res.status(200).json({ id })
37+
// call your database, etc.
38+
// const id = await createItem(data)
39+
// ...
40+
res.status(200).json({ data })
3941
}
4042
```
4143

0 commit comments

Comments
 (0)