import { Handlers, PageProps } from '$fresh/server.ts' import { useSignal } from '@preact/signals' import Counter from '../islands/Counter.tsx' import { db, Todo, User } from '$models' interface Data { users: User[] unassignedTodos: Todo[] } export const handler: Handlers = { async GET(_req, ctx) { const users = await db.users.findMany({ include: { assignedTodos: true } }) const unassignedTodos = await db.todos.findMany({ where: { assigneeUserId: null }, }) return ctx.render({ users, unassignedTodos }) }, } export default function Home(props: PageProps) { const count = useSignal(3) return (
the Fresh logo: a sliced lemon dripping with juice

Welcome to Fresh

Try updating this message in the ./routes/index.tsx file, and refresh.

) }