diff options
| author | mat <github@matdoes.dev> | 2022-06-17 14:55:34 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-06-17 14:55:34 -0500 |
| commit | 90f4b2c916cdd7f61843c7a2c7f4451d44e18367 (patch) | |
| tree | 887d5120cbd7823345183ee5556f72a538c57ea4 /src/routes/leaderboards | |
| parent | b68a711c131d29a396440f2f76963ec5593aa3e7 (diff) | |
| download | skyblock-stats-90f4b2c916cdd7f61843c7a2c7f4451d44e18367.tar.gz skyblock-stats-90f4b2c916cdd7f61843c7a2c7f4451d44e18367.tar.bz2 skyblock-stats-90f4b2c916cdd7f61843c7a2c7f4451d44e18367.zip | |
Fix being ratelimited sometimes
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: { |
