From a3512b12428fcd48aeb65e76d0d06f12057790ab Mon Sep 17 00:00:00 2001 From: zkldi Date: Tue, 7 Sep 2021 12:54:23 +0100 Subject: [PATCH] Fix bug with deprimarification --- server/src/server/router/api/v1/admin/router.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/src/server/router/api/v1/admin/router.ts b/server/src/server/router/api/v1/admin/router.ts index ff2936645..7e9bd16da 100644 --- a/server/src/server/router/api/v1/admin/router.ts +++ b/server/src/server/router/api/v1/admin/router.ts @@ -105,6 +105,8 @@ router.post( * its score data. * * @param chartID - the chartID to deprimarify. + * @param game - The game this chart is on. + * @param songID - Alternatively, this will deprimarify all charts for this songID. * * @name POST /api/v1/admin/deprimarify */ @@ -157,7 +159,7 @@ router.post( await coll.update( { - chartID: req.body.chartID, + chartID: chart.chartID, }, { $set: { @@ -169,7 +171,7 @@ router.post( logger.info(`Emptying all calculated data for this chart.`); await db.scores.update( - { chartID: req.body.chartID }, + { chartID: chart.chartID }, { $set: { calculatedData: {}, @@ -182,7 +184,7 @@ router.post( await db["personal-bests"].update( { - chartID: req.body.chartID, + chartID: chart.chartID, }, { $set: {