fix: change MultiHandler back to Handlers (#1396)

This commit is contained in:
Marvin Hagemeister
2023-07-03 09:57:46 +02:00
committed by GitHub
parent eb53d53ab8
commit 16be99e69b
32 changed files with 135 additions and 66 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ interface Project {
stars: number;
}
export const handler: MultiHandler<Project> = {
export const handler: Handlers<Project> = {
async GET(_req, ctx) {
const project = await db.projects.findOne({ id: ctx.params.id });
if (!project) {
@@ -36,7 +36,7 @@ export default function ProjectPage(props: PageProps<Project>) {
}
```
The type parameter on the `PageProps`, `MultiHandler`, `Handler`, and
The type parameter on the `PageProps`, `Handlers`, `Handler`, and
`HandlerContext` can be used to enforce a TypeScript type to use for the render
data. Fresh enforces during type checking that the types in all of these fields
are compatible within a single page.