fix: make tram work again
All checks were successful
deploy to cloudflare pages / deploy (push) Successful in 32s

This commit is contained in:
uku 2024-11-22 09:55:21 +01:00
parent e96718c273
commit d1a3772f6c
Signed by: uku
SSH key fingerprint: SHA256:4P0aN6M8ajKukNi6aPOaX0LacanGYtlfjmN+m/sHY/o
2 changed files with 4 additions and 3 deletions

View file

@ -15,6 +15,7 @@ let lazyStops: GeoJSON.Feature[] | null = null;
export async function createGame(
userId: string,
mode: string,
stopsType: string,
stops: GeoJSON.Feature[],
db: D1Database,
): Promise<ClientGameData> {
@ -23,9 +24,9 @@ export async function createGame(
const gameSql = db
.prepare(
"INSERT INTO game (id, user_id, mode, time, total_score) VALUES (?, ?, ?, unixepoch('now'), 0)",
"INSERT INTO game (id, user_id, mode, stops_type, time, total_score) VALUES (?, ?, ?, ?, unixepoch('now'), 0)",
)
.bind(uuid, userId, mode);
.bind(uuid, userId, mode, stopsType);
const roundSql = db.prepare(
"INSERT INTO round (game_id, points, distance, stop_name) VALUES (?, -1, -1, ?)",

View file

@ -18,7 +18,7 @@ export const GET: RequestHandler = async ({ url, platform, locals }) => {
error(400, "could not select random stop");
}
const gameData = await createGame(user.id, options.mode, randomStops, db);
const gameData = await createGame(user.id, options.mode, options.stopsType, randomStops, db);
return Response.json(gameData);
};