fixes, qol and stuff
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
export const prerender = true;
|
||||
|
||||
import { type StoreEntity } from "../+page.server.ts";
|
||||
|
||||
export type ProductPageData = {
|
||||
product: StoreEntity;
|
||||
slug: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
const Catalog: Record<string, StoreEntity> = {};
|
||||
|
||||
Catalog["MagicCircle"] = { images: ["MagicCircle"], name: "Magic Circle", description: "Mreowww", short: "magiccircle", category: "Amulets", gumroad: "https://doloro.gumroad.com/l/Amulet", jinxxy: "" }
|
||||
|
||||
export function entries() {
|
||||
return Object.keys(Catalog).map((slug) => ({ slug }));
|
||||
}
|
||||
|
||||
export async function load({ params }: { params: { slug: string } }) {
|
||||
const slug = params.slug;
|
||||
const product = Catalog[slug];
|
||||
|
||||
if (!product) {
|
||||
throw new Error(`Product not found: ${slug}`);
|
||||
}
|
||||
|
||||
return {
|
||||
product,
|
||||
slug,
|
||||
url: `/store/${slug}`
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user