From 7af80da8028cacf82f65db5405255907dad1c28a Mon Sep 17 00:00:00 2001 From: iain maitland Date: Mon, 18 Dec 2023 15:45:31 -0500 Subject: [PATCH] docs: add missing import (#2183) fix undefined var error. --- docs/latest/concepts/forms.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/latest/concepts/forms.md b/docs/latest/concepts/forms.md index 271071ed..1f83b476 100644 --- a/docs/latest/concepts/forms.md +++ b/docs/latest/concepts/forms.md @@ -63,7 +63,7 @@ File uploads can be handled in a very similar manner to the example above. Note that this time, we have to explicitly declare the form's encoding. ```tsx routes/subscribe.tsx -import { Handlers } from "$fresh/server.ts"; +import { Handlers, type RouteContext } from "$fresh/server.ts"; export const handler: Handlers = { async GET(req, ctx) { @@ -90,7 +90,8 @@ export const handler: Handlers = { }, }; -export default function Upload() { +export default function Upload(req: Request, ctx: RouteContext) { + const { message } = ctx.data; return ( <>