Lots of changes, started on working /add

This commit is contained in:
2023-06-21 19:50:27 +02:00
parent 21411fa73a
commit 9feb0c273e
140 changed files with 489 additions and 262 deletions
+4 -1
View File
@@ -2,10 +2,13 @@
import type { PageLoad } from "./$types";
//import { Recipe } from '../../../models/Recipe';
//import { dbConnect, dbDisconnect } from '../../../utils/db';
import { error } from "@sveltejs/kit";
export async function load({ fetch, params }) {
const res = await fetch(`/api/items/${params.name}`);
const item = await res.json();
if(res.status != 200){
throw error(res.status, item.message)
}
return item;
};