Skip to content

Commit e614466

Browse files
committed
fix knex query string
1 parent 3b46972 commit e614466

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

svc/rater.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ async function doRate() {
2020
}
2121
// Get ratings of all players in the match, otherwise default value
2222
const accountIds = gcMatch.players.map(p => p.account_id);
23-
console.log(accountIds);
24-
const { rows: existingRatings } = await db.raw<{rows: {account_id: number, computed_mmr: number}[]}>('SELECT account_id, computed_mmr FROM player_computed_mmr WHERE account_id IN ?', [accountIds]);
23+
// console.log(accountIds);
24+
const { rows: existingRatings } = await db.raw<{rows: {account_id: number, computed_mmr: number}[]}>(`SELECT account_id, computed_mmr FROM player_computed_mmr WHERE account_id IN ${accountIds.map(_ => '?').join(',')}`, [...accountIds]);
2525
const ratingMap = new Map<number, number>();
2626
existingRatings.forEach((r) => {
2727
ratingMap.set(r.account_id, r.computed_mmr);

0 commit comments

Comments
 (0)