mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
docs: add explicit await
to clarify sendRedirect
is async (#23345)
This commit is contained in:
parent
ff8a040055
commit
dd0ffaa84c
@ -315,8 +315,8 @@ export default defineEventHandler((event) => {
|
||||
### Sending Redirect
|
||||
|
||||
```ts [server/api/foo.get.ts]
|
||||
export default defineEventHandler((event) => {
|
||||
return sendRedirect(event, '/path/redirect/to', 302)
|
||||
export default defineEventHandler(async (event) => {
|
||||
await sendRedirect(event, '/path/redirect/to', 302)
|
||||
})
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user