Skip to content

Commit

Permalink
fix: hacky way to fix base url issue (#106)
Browse files Browse the repository at this point in the history
commit 2ea43bf
Author: Dominik Moritz <domoritz@gmail.com>
Date:   Tue May 16 21:36:24 2023 +0200

    fix: hacky way to fix base url issue
  • Loading branch information
domoritz committed May 16, 2023
1 parent 307e72e commit 40a4d21
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/loaders/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import type { Confusion } from '../confusions';

// TODO: Write test case
export async function json(filename: string): Promise<Array<Confusion>> {
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;
}

0 comments on commit 40a4d21

Please sign in to comment.