File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -8,23 +8,21 @@ import { ExampleArrow } from "../homepage/ExampleArrow.tsx";
88import { FancyLink } from "../FancyLink.tsx" ;
99import { FormSubmitDemo } from "../../islands/FormSubmitDemo.tsx" ;
1010
11- const routingCode = `import { Handlers } from "$fresh/server .ts";
11+ const routingCode = `import { define } from "../utils .ts";
1212
13- export const handler: Handlers = {
14- async POST(req ) {
15- const form = await req.formData();
13+ export const handler = define.handlers( {
14+ async POST(ctx ) {
15+ const form = await ctx. req.formData();
1616
1717 // Do something with the form data here,
1818 // then redirect user to thank you page
1919
20- const headers = new Headers();
21- headers.set("location", "/thanks");
2220 return new Response(null, {
2321 status: 303,
24- headers,
22+ headers: { location: "/thanks" } ,
2523 });
2624 },
27- };` ;
25+ }) ;` ;
2826
2927export function FormsSection ( ) {
3028 return (
You can’t perform that action at this time.
0 commit comments