From 61612c8e1861ac704bbe592a623a41f12ebc9c11 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Tue, 3 Jan 2023 22:41:20 -0500 Subject: Add a messy but mostly working UI --- ui/src/routes/list/+page.js | 26 ++++++++++++++++--------- ui/src/routes/list/+page.svelte | 42 ++++++++++++++++++++++++++++++++++------- 2 files changed, 52 insertions(+), 16 deletions(-) (limited to 'ui/src/routes/list') diff --git a/ui/src/routes/list/+page.js b/ui/src/routes/list/+page.js index 1c0c1d5..85435b1 100644 --- a/ui/src/routes/list/+page.js +++ b/ui/src/routes/list/+page.js @@ -1,14 +1,22 @@ +/** @type {import('./$types').PageLoad} */ +// export async function load({ fetch, params }) { +// const res = await fetch(`/api/v1/list`); +// const item = await res.json(); +//   +// return { item }; +// } + /** @type {import('./$types').PageLoad} */ -export async function load({ params }) { - const req = await fetch(`http://localhost:6130/api/v1/list`) - const reqJson = await req.json(); - - return { - req: req, - reqJson: reqJson, - }; -} +// export async function load({ params }) { +// const req = await fetch(`http://localhost:6130/api/v1/list`) +// const reqJson = await req.json(); +// +// return { +// req: req, +// reqJson: reqJson, +// }; +// } diff --git a/ui/src/routes/list/+page.svelte b/ui/src/routes/list/+page.svelte index 3b463b5..1986665 100644 --- a/ui/src/routes/list/+page.svelte +++ b/ui/src/routes/list/+page.svelte @@ -1,17 +1,43 @@ - {#if data} +{:else if Err} +{Err} {:else} Loading.... {/if} -- cgit v1.2.3