aboutsummaryrefslogtreecommitdiff
path: root/web/pw-server/src/lib/components/Leaderboard.svelte
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-08-21 21:18:06 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-08-21 21:18:06 +0200
commit8eec57f5606c1d1757383f4c0ca40d2cc3334572 (patch)
tree49d69c8864f59db52061f1222a43e00266e6ab04 /web/pw-server/src/lib/components/Leaderboard.svelte
parent64d24c9e3d7e744788644b00cdb2ec44a999d9cd (diff)
downloadplanetwars.dev-8eec57f5606c1d1757383f4c0ca40d2cc3334572.tar.xz
planetwars.dev-8eec57f5606c1d1757383f4c0ca40d2cc3334572.zip
extract leaderboard from editor
Diffstat (limited to 'web/pw-server/src/lib/components/Leaderboard.svelte')
-rw-r--r--web/pw-server/src/lib/components/Leaderboard.svelte17
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"];