diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-08-21 21:18:06 +0200 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-08-21 21:18:06 +0200 |
commit | 8eec57f5606c1d1757383f4c0ca40d2cc3334572 (patch) | |
tree | 49d69c8864f59db52061f1222a43e00266e6ab04 /web/pw-server/src/lib | |
parent | 64d24c9e3d7e744788644b00cdb2ec44a999d9cd (diff) | |
download | planetwars.dev-8eec57f5606c1d1757383f4c0ca40d2cc3334572.tar.xz planetwars.dev-8eec57f5606c1d1757383f4c0ca40d2cc3334572.zip |
extract leaderboard from editor
Diffstat (limited to 'web/pw-server/src/lib')
-rw-r--r-- | web/pw-server/src/lib/components/Leaderboard.svelte | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/web/pw-server/src/lib/components/Leaderboard.svelte b/web/pw-server/src/lib/components/Leaderboard.svelte index d29d5d6..ea30384 100644 --- a/web/pw-server/src/lib/components/Leaderboard.svelte +++ b/web/pw-server/src/lib/components/Leaderboard.svelte @@ -1,20 +1,5 @@ <script lang="ts"> - import { onMount } from "svelte"; - - let leaderboard = []; - - onMount(async () => { - const res = await fetch("/api/leaderboard", { - headers: { - "Content-Type": "application/json", - }, - }); - - if (res.ok) { - leaderboard = await res.json(); - console.log(leaderboard); - } - }); + export let leaderboard; function formatRating(entry: object): any { const rating = entry["rating"]; |