trying to add score updates

This commit is contained in:
2026-05-06 20:00:30 +01:00
parent 94c139c7b8
commit fdfbd4c7c7
7 changed files with 32 additions and 642 deletions

View File

@@ -1,13 +1,20 @@
import { db } from '$lib/server/db';
import * as schema from '$lib/server/db/schema';
export class House {
name: string = '';
color: string = 'white';
points: number = $state(0);
}
import type { Actions } from './$types';
export const load = async () => {
return await getTeams();
};
export const actions = {
addEntry: async (event) => {
console.log('something');
}
} satisfies Actions;
let testScore = 0;
export async function getTeams() {
const allTeams = await db.select().from(schema.teamScoresView);
console.log(allTeams);
return {
@@ -15,7 +22,7 @@ export const load = async () => {
...team,
name: team.teamName,
color: team.teamColor,
points: team.totalPoints || 0
points: team.totalPoints || testScore
}))
};
};
}