Added a the sludgefest clicker. We'll see how broken it is

This commit is contained in:
2025-08-09 09:31:12 -05:00
parent 98add416f0
commit 3803a43248
4 changed files with 136 additions and 5 deletions
+24
View File
@@ -0,0 +1,24 @@
import { get_fest_counts, add_fest_counts } from '$lib/db'
export async function load() {
console.log('click')
let { people, tents, cars, year } = await get_fest_counts()
console.log({ people, tents, cars, year })
return {
people,
tents,
cars,
year
}
}
export const actions = {
default: async ({ cookies, fetch, getClientAddress, locals, params, platform, request, route, setHeaders, url, isDataRequest }) => {
const data = await request.formData()
console.log("save", data)
const people = parseInt(data.get("people"))
const tents = parseInt(data.get("tents"))
const cars = parseInt(data.get("cars"))
const reply = add_fest_counts(people, tents, cars, 25)
console.log("reply", reply)
}
}