From b98c317ba49bcfc69c34039545cb1cc2228117ee Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Wed, 30 Aug 2023 21:33:20 +0100 Subject: [PATCH] Further adjustments to new staff ldb --- src/lib/ldb/staff/staff-ldb.svelte | 31 +++++++++++++++++++++++++++--- src/lib/scripts/upstream.ts | 9 +++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 src/lib/scripts/upstream.ts diff --git a/src/lib/ldb/staff/staff-ldb.svelte b/src/lib/ldb/staff/staff-ldb.svelte index c976e37..d7db1ad 100644 --- a/src/lib/ldb/staff/staff-ldb.svelte +++ b/src/lib/ldb/staff/staff-ldb.svelte @@ -1,14 +1,39 @@ +{#await fetchStaffLdb(station)} + Loading +{:then data} + Loaded {JSON.stringify(data)} +{:catch} + Error Loading +{/await} diff --git a/src/lib/scripts/upstream.ts b/src/lib/scripts/upstream.ts new file mode 100644 index 0000000..8b02fa5 --- /dev/null +++ b/src/lib/scripts/upstream.ts @@ -0,0 +1,9 @@ +import { dev } from "$app/environment"; + +export function getApiUrl() { + if (dev) { + console.info("DEVMODE active, using testing URL") + return "https://testing.owlboard.info" + } + return "https://owlboard.info" +} \ No newline at end of file