mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-25 07:17:23 +08:00
fixed function that searches by objectid
This commit is contained in:
parent
b931730ae9
commit
febee299ba
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue