backport fix for update-score.ts

This commit is contained in:
zkldi
2022-01-10 10:01:00 +00:00
parent 50677ea30c
commit e7accd1113
@@ -67,6 +67,14 @@ export default async function UpdateScore(oldScore: ScoreDocument, newScore: Sco
);
try {
if (newScore._id) {
logger.warn(
`Passed a score with _id to UpdateScore. This property should not be set. Deleting this property and continuing anyway.`
);
// This property shouldn't be defined.
delete newScore._id;
}
await db.scores.update(
{
scoreID: oldScoreID,