mirror of
https://github.com/Xevion/banner.git
synced 2026-01-31 14:23:36 -06:00
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.
14 lines
380 B
TypeScript
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 };
|
|
}
|
|
};
|