This commit is contained in:
Mr Swift
2024-08-19 02:25:50 +03:30
parent dc2189c269
commit 59a608d616
8 changed files with 20 additions and 20 deletions
+5 -5
View File
@@ -24,15 +24,15 @@ module.exports.getAll = async (req, res) => {
page = req.query.page
page = page * rows - rows
}
const search = req.query?.search ? req.query.search : ""
// const search = req.query?.search ? req.query.search : ""
const score = await Score.find({
userId: req.user_id,
$or: [
{ title: { $regex: search } },
{ score: { $regex: search } },
],
// $or: [
// { title: { $regex: search } },
// { score: { $regex: search } },
// ],
}).skip(page).limit(rows);
const total = Math.ceil((await Score.countDocuments({ userId: req.user_id })))