collection name typos

This commit is contained in:
Miodec 2021-07-07 14:04:28 +01:00
parent c25986e407
commit 032621a0d8

View file

@ -16,7 +16,7 @@ class ResultDAO {
}
static async editResultTags(uid, id, tags) {
const result = await mongoDB().collection("result").findOne({ id, uid });
const result = await mongoDB().collection("results").findOne({ id, uid });
if (!result) throw new MonkeyError(404, "Result not found");
const userTags = await UserDAO.getTags(uid);
let validTags = true;
@ -31,7 +31,7 @@ class ResultDAO {
}
static async getResult(uid, id) {
const result = await mongoDB().collection("result").findOne({ id, uid });
const result = await mongoDB().collection("results").findOne({ id, uid });
if (!result) throw new MonkeyError(404, "Result not found");
return result;
}
@ -40,7 +40,7 @@ class ResultDAO {
start = start ?? 0;
end = end ?? 1000;
const result = await mongoDB()
.collection("result")
.collection("results")
.find({ uid })
.sort({ timestamp: -1 })
.skip(start)