Skip to content

Commit 4987253

Browse files
Fix adding a new game to METAGAMES COUNTS
1 parent 0b317b3 commit 4987253

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/abstractplay.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,8 @@ async function verifyAndCorrectCountWithData(metaGame: string, countType: "curre
438438
TableName: process.env.ABSTRACT_PLAY_TABLE,
439439
Key: { "pk": "METAGAMES", "sk": "COUNTS" },
440440
ExpressionAttributeNames: { "#g": metaGame },
441-
ExpressionAttributeValues: { ":count": actualCount },
442-
UpdateExpression: `set #g.${countType} = :count`
441+
ExpressionAttributeValues: { ":gameData": { [countType]: actualCount } },
442+
UpdateExpression: `set #g = :gameData`
443443
}));
444444
console.log(`Initialized ${countType} for ${metaGame} to ${actualCount}`);
445445
return;
@@ -454,8 +454,8 @@ async function verifyAndCorrectCountWithData(metaGame: string, countType: "curre
454454
TableName: process.env.ABSTRACT_PLAY_TABLE,
455455
Key: { "pk": "METAGAMES", "sk": "COUNTS" },
456456
ExpressionAttributeNames: { "#g": metaGame },
457-
ExpressionAttributeValues: { ":count": actualCount },
458-
UpdateExpression: `set #g.${countType} = :count`
457+
ExpressionAttributeValues: { ":gameData": { [countType]: actualCount } },
458+
UpdateExpression: `set #g = :gameData`
459459
}));
460460
console.log(`Initialized ${countType} for new game ${metaGame} to ${actualCount}`);
461461
return;

0 commit comments

Comments
 (0)