id: {todo.id}
21 |description: {todo.description}
22 | 23 | Tasks 24 | -------------------------------------------------------------------------------- /src/routes/todos/[id]/tasks/+page.server.ts: -------------------------------------------------------------------------------- 1 | import type { PageServerLoad } from "./$types"; 2 | 3 | export const load: PageServerLoad = async ({ params }) => { 4 | const { id } = params; 5 | if (id == "1") { 6 | return { 7 | todo: { 8 | id: 1, 9 | name: "My First Todo", 10 | description: "Here is a description of my first todo", 11 | }, 12 | }; 13 | } else if (id == "2") { 14 | return { 15 | todo: { 16 | id: 2, 17 | name: "My Second Todo", 18 | description: "Here is a description of my second todo", 19 | }, 20 | }; 21 | } 22 | }; 23 | -------------------------------------------------------------------------------- /src/routes/todos/[id]/tasks/+page.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 |