From 1f423f09c8b6a68819e9cca4499e73a9a24be5a7 Mon Sep 17 00:00:00 2001 From: Drew Echerd Date: Tue, 15 Feb 2022 16:43:15 +0500 Subject: [PATCH] Add GET and POST endpoints. --- src/app.d.ts | 7 +++++++ src/lib/todo-item.svelte | 6 +++++- src/routes/index.svelte | 32 +++++++++++++++++++++++++++----- src/routes/todos/index.json.ts | 29 +++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 src/routes/todos/index.json.ts diff --git a/src/app.d.ts b/src/app.d.ts index 7090ee7..e7dd0d9 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -1,5 +1,11 @@ /// +type Todo = { + create_at: Date; + text: string; + done: boolean; +} + // See https://kit.svelte.dev/docs/typescript // for information about these interfaces declare namespace App { @@ -11,3 +17,4 @@ declare namespace App { interface Stuff {} } + diff --git a/src/lib/todo-item.svelte b/src/lib/todo-item.svelte index dfa08a4..2ea460e 100644 --- a/src/lib/todo-item.svelte +++ b/src/lib/todo-item.svelte @@ -1,3 +1,7 @@ + +
@@ -5,7 +9,7 @@
- +