fix typos

This commit is contained in:
zkldi
2021-08-20 19:38:01 +01:00
parent 1afb0dd729
commit 1cf44315f9
2 changed files with 16 additions and 2 deletions
@@ -40,7 +40,7 @@ t.test("GET /api/v1/games/:game/:playtype/tables/:tableID", (t) => {
});
t.test("Should return 404 if the table does not exist.", async (t) => {
const res = await mockApi.get("/api/v1/games/iidx/SP/tables/non_existant_table");
const res = await mockApi.get("/api/v1/games/iidx/SP/tables/non_existent_table");
t.equal(res.statusCode, 404);
@@ -35,7 +35,7 @@ router.get("/", async (req, res) => {
logger.error(
`Score ${
score.scoreID
} refers to non-existant data: [user,chart,song] [${!!user} ${!!chart} ${!!song}]`
} refers to non-existent data: [user,chart,song] [${!!user} ${!!chart} ${!!song}]`
);
return res.status(500).json({
@@ -110,6 +110,20 @@ router.patch(
{ $set: modifyOption }
);
if (modifyOption.highlight === true || modifyOption.highlight === false) {
await db["personal-bests"].findOneAndUpdate(
{
chartID: score.chartID,
userID: score.userID,
},
{
$set: {
highlight: modifyOption.highlight,
},
}
);
}
return res.status(200).json({
success: true,
description: `Updated score.`,