Compare commits
2 Commits
c14958e5bf
...
35c0003159
| Author | SHA1 | Date | |
|---|---|---|---|
| 35c0003159 | |||
| 5a6156adb7 |
@ -329,6 +329,7 @@
|
||||
"seasonpicks",
|
||||
"substitutions",
|
||||
"teams",
|
||||
"scraped_startinggrids",
|
||||
"scraped_raceresults",
|
||||
"scraped_driverstandings",
|
||||
"scraped_teamstandings",
|
||||
@ -347,6 +348,7 @@
|
||||
"seasonpicks",
|
||||
"substitutions",
|
||||
"teams",
|
||||
"scraped_startinggrids",
|
||||
"scraped_raceresults",
|
||||
"scraped_driverstandings",
|
||||
"scraped_teamstandings",
|
||||
|
||||
@ -1,10 +1,14 @@
|
||||
<script lang="ts">
|
||||
import { Button } from "$lib/components";
|
||||
import { pbUser } from "$lib/pocketbase";
|
||||
import type { Snippet } from "svelte";
|
||||
|
||||
let { children }: { children: Snippet } = $props();
|
||||
|
||||
const scrape_official_data = async () => {
|
||||
// TODO: Unauthorized toast
|
||||
if (!$pbUser || !$pbUser.admin) return;
|
||||
|
||||
// TODO: Success/error toast
|
||||
const response: Response = await fetch("/api/scrape", { method: "POST" });
|
||||
};
|
||||
@ -24,7 +28,13 @@
|
||||
<!-- Each child's contents will be inserted here -->
|
||||
<div style="margin-top: 56px;">
|
||||
<div class="pb-2">
|
||||
<Button width="w-full" color="tertiary" onclick={scrape_official_data} shadow>
|
||||
<Button
|
||||
width="w-full"
|
||||
color="tertiary"
|
||||
onclick={scrape_official_data}
|
||||
shadow
|
||||
disabled={!$pbUser?.admin}
|
||||
>
|
||||
<span class="font-bold">Refresh All Data</span>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user