diff options
Diffstat (limited to 'src/routes/leaderboards')
| -rw-r--r-- | src/routes/leaderboards/[name].svelte | 4 | ||||
| -rw-r--r-- | src/routes/leaderboards/index.svelte | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/routes/leaderboards/[name].svelte b/src/routes/leaderboards/[name].svelte index ea1f658..75000a9 100644 --- a/src/routes/leaderboards/[name].svelte +++ b/src/routes/leaderboards/[name].svelte @@ -1,9 +1,9 @@ <script lang="ts" context="module"> import type { Load } from '@sveltejs/kit' - import { API_URL } from '$lib/api' + import { fetchApi } from '$lib/api' export const load: Load = async ({ params, fetch }) => { - const dataText = await fetch(`${API_URL}leaderboards/${params.name}`).then(r => r.text()) + const dataText = await fetchApi(`leaderboards/${params.name}`, fetch).then(r => r.text()) const data = JSON.parse(dataText) diff --git a/src/routes/leaderboards/index.svelte b/src/routes/leaderboards/index.svelte index a6470ff..50687c8 100644 --- a/src/routes/leaderboards/index.svelte +++ b/src/routes/leaderboards/index.svelte @@ -1,9 +1,9 @@ <script lang="ts" context="module"> import type { Load } from '@sveltejs/kit' - import { API_URL } from '$lib/api' + import { fetchApi } from '$lib/api' - export const load: Load = async ({ params, fetch }) => { - const data = await fetch(`${API_URL}leaderboards`).then(r => r.json()) + export const load: Load = async ({ fetch }) => { + const data = await fetchApi(`leaderboards`, fetch).then(r => r.json()) return { props: { |
