Files
banner/web/src/routes/+page.ts
Xevion 61f8bd9de7 refactor: consolidate menu snippets and strengthen type safety
Replaces duplicated dropdown/context menu code with parameterized snippet,
eliminates unsafe type casts, adds error handling for clipboard and API
calls, and improves accessibility annotations.
2026-01-29 11:40:55 -06:00

14 lines
380 B
TypeScript

import type { PageLoad } from "./$types";
import { BannerApiClient } from "$lib/api";
export const load: PageLoad = async ({ url, fetch }) => {
const client = new BannerApiClient(undefined, fetch);
try {
const terms = await client.getTerms();
return { terms, url };
} catch (e) {
console.error("Failed to load terms:", e);
return { terms: [], url };
}
};