Added a the sludgefest clicker. We'll see how broken it is
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user