docs: add explicit await to clarify sendRedirect is async (#23345)

This commit is contained in:
Josh Deltener 2023-09-22 02:20:03 -05:00 committed by GitHub
parent ff8a040055
commit dd0ffaa84c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
})
```