diff --git a/src/routes/settings/type/+page.server.ts b/src/routes/settings/type/+page.server.ts new file mode 100644 index 0000000..f0e2b57 --- /dev/null +++ b/src/routes/settings/type/+page.server.ts @@ -0,0 +1,13 @@ +import type { PageServerLoad } from "./$types"; + +export const load: PageServerLoad = async ({ fetch }) => { + const typesPromise = fetch("/api/type/all").then((res) => res.json()); + const settingsPromise = fetch("/api/settings/type/all").then((res) => res.json()); + const [types, storedFilters] = await Promise.all([typesPromise, settingsPromise]); + if (storedFilters) { + return { types: types, storedFilters: storedFilters }; + } else { + return { types: types, storedFilters: [] }; + } +}; + diff --git a/src/routes/settings/type/+page.svelte b/src/routes/settings/type/+page.svelte new file mode 100644 index 0000000..13cf4ea --- /dev/null +++ b/src/routes/settings/type/+page.svelte @@ -0,0 +1,159 @@ + + +{#if error} +
{error}
+{/if} + +