user displayed in navbar with option to logout
This commit is contained in:
10
src/routes/(rezepte)/rezepte/[name]/+page.ts
Normal file
10
src/routes/(rezepte)/rezepte/[name]/+page.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user