docs: fix syntax error on "Error Pages" page (#668)
This commit is contained in:
@@ -36,15 +36,15 @@ This can be achieved with `ctx.renderNotFound`.
|
|||||||
import { h } from "preact";
|
import { h } from "preact";
|
||||||
import { Handlers, PageProps } from "$fresh/server.ts";
|
import { Handlers, PageProps } from "$fresh/server.ts";
|
||||||
|
|
||||||
export handler: Handlers = {
|
export const handler: Handlers = {
|
||||||
async GET(req, ctx) {
|
async GET(req, ctx) {
|
||||||
const blogpost = await fetchBlogpost(ctx.params.slug)
|
const blogpost = await fetchBlogpost(ctx.params.slug);
|
||||||
if (!blogpost) {
|
if (!blogpost) {
|
||||||
return ctx.renderNotFound();
|
return ctx.renderNotFound();
|
||||||
}
|
}
|
||||||
return ctx.render({ blogpost })
|
return ctx.render({ blogpost });
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
export default function BlogpostPage({ data }) {
|
export default function BlogpostPage({ data }) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user