added single day history button

This commit is contained in:
George Powell
2026-02-26 15:04:34 -05:00
parent e550965086
commit a188be167b
2 changed files with 13 additions and 5 deletions

View File

@@ -6,14 +6,14 @@
let seeding = $state(false);
async function seedHistory() {
async function seedHistory(days: number = 10) {
if (!browser || !anonymousId || seeding) return;
seeding = true;
try {
const response = await fetch("/api/dev/seed-history", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ anonymousId })
body: JSON.stringify({ anonymousId, days })
});
const result = await response.json();
alert(
@@ -113,7 +113,15 @@
<Button
variant="secondary"
onclick={seedHistory}
onclick={() => seedHistory(1)}
disabled={seeding}
class="w-full py-4 md:py-2"
>
{seeding ? "Seeding..." : "Add 1 Day of History"}
</Button>
<Button
variant="secondary"
onclick={() => seedHistory(10)}
disabled={seeding}
class="w-full py-4 md:py-2"
>