trying to add score updates
This commit is contained in:
@@ -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
|
||||
}))
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user