From 3c1d02797719e418792cfde8f4129daff5b8f65f Mon Sep 17 00:00:00 2001 From: OrlS15 <78907050+OrlS15@users.noreply.github.com> Date: Mon, 4 Sep 2023 10:22:52 +0200 Subject: [PATCH] docs: fix types in 'server utilities' example (#22978) --- docs/2.guide/2.directory-structure/1.server.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/2.guide/2.directory-structure/1.server.md b/docs/2.guide/2.directory-structure/1.server.md index 68e418f4ff..90f5fbd3b6 100644 --- a/docs/2.guide/2.directory-structure/1.server.md +++ b/docs/2.guide/2.directory-structure/1.server.md @@ -111,10 +111,12 @@ For example, you can define a custom handler utility that wraps the original han **Example:** ```ts [server/utils/handler.ts] -import type { EventHandler } from 'h3' +import type { EventHandler, EventHandlerRequest } from 'h3' -export const defineWrappedResponseHandler = (handler: EventHandler) => - defineEventHandler(async (event) => { +export const defineWrappedResponseHandler = ( + handler: EventHandler +): EventHandler => + defineEventHandler(async event => { try { // do something before the route handler const response = await handler(event)