fixed function that searches by objectid

This commit is contained in:
Jack 2021-09-07 15:03:24 +01:00
parent b931730ae9
commit febee299ba

View file

@ -42,7 +42,9 @@ class ResultDAO {
}
static async getResult(uid, id) {
const result = await mongoDB().collection("results").findOne({ id, uid });
const result = await mongoDB()
.collection("results")
.findOne({ _id: ObjectID(id), uid });
if (!result) throw new MonkeyError(404, "Result not found");
return result;
}