fix: make tram work again
All checks were successful
deploy to cloudflare pages / deploy (push) Successful in 32s
All checks were successful
deploy to cloudflare pages / deploy (push) Successful in 32s
This commit is contained in:
parent
e96718c273
commit
d1a3772f6c
2 changed files with 4 additions and 3 deletions
|
@ -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, ?)",
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue