aboutsummaryrefslogtreecommitdiff
path: root/web/pw-server/src/routes/leaderboard.svelte
blob: 7c4da6eb35c75f6dca53aaf45e9c802b30d0b84b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<script lang="ts" context="module">
  import { ApiClient } from "$lib/api_client";

  export async function load({ fetch }) {
    try {
      const apiClient = new ApiClient(fetch);
      const leaderboard = await apiClient.get("/api/leaderboard");
      return {
        props: {
          leaderboard,
        },
      };
    } catch (error) {
      return {
        status: error.status,
        error: error,
      };
    }
  }
</script>

<script lang="ts">
  import Leaderboard from "$lib/components/Leaderboard.svelte";

  export let leaderboard: object[];
</script>

<Leaderboard {leaderboard} />