import type { PageLoad } from './$types';
import type { TodoItem } from '$lib/api/types';
import { readTodo } from '$lib/api/endpoints';

export const ssr = false;
export const load = (async ({ params }) => {
  // check if user exists
  const todoId = params.todo;
  const todo = await readTodo(todoId);
  return {
    todo: todo
  };

}) satisfies PageLoad;

export interface TodoDetailPage {
  todo: TodoItem
}
