You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
318 B
TypeScript

import { error } from "@sveltejs/kit";
import type { PageLoad } from "./$types";
import { plants, type PlantData } from "$lib/plants";
export const load: PageLoad = ({ params }) => {
console.log(plants);
if (plants[params.plant]) {
return plants[params.plant] as PlantData;
}
throw error(404, "Not found");
};