user displayed in navbar with option to logout

This commit is contained in:
2023-07-19 14:52:50 +02:00
parent 8f045d7111
commit 2b0c954aa5
11 changed files with 189 additions and 28 deletions

View File

@@ -0,0 +1,10 @@
import { error } from "@sveltejs/kit";
export async function load({ fetch, params}) {
const res = await fetch(`/api/items/${params.name}`);
let item = await res.json();
if(!res.ok){
throw error(res.status, item.message)
}
return item;
}