From 40a4d212be425e042335277b7a14196a8f4a101a Mon Sep 17 00:00:00 2001 From: Dominik Moritz Date: Tue, 16 May 2023 23:20:38 +0200 Subject: [PATCH] fix: hacky way to fix base url issue (#106) commit 2ea43bf3a803b5305db42d99323f5a88fea7aae8 Author: Dominik Moritz Date: Tue May 16 21:36:24 2023 +0200 fix: hacky way to fix base url issue --- src/lib/loaders/json.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/loaders/json.ts b/src/lib/loaders/json.ts index ad846fc..eda8be0 100644 --- a/src/lib/loaders/json.ts +++ b/src/lib/loaders/json.ts @@ -8,7 +8,8 @@ import type { Confusion } from '../confusions'; // TODO: Write test case export async function json(filename: string): Promise> { - const response = await fetch(filename); + // TODO: should use https://kit.svelte.dev/docs/load or some other way to load data that does not involve using window.location.href + const response = await fetch(`${window.location.href}/${filename}`); const json = await response.json(); return json.data.values; }