Fix options

This commit is contained in:
Mr Swift
2024-08-17 11:49:59 +03:30
parent ba6f1bd1bb
commit 1faa12e156
3 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -64,9 +64,9 @@ module.exports.getAllForUser = async (req, res) => {
const data = await Withdraw.find({
userId: req.user_id,
$or: [
{ amount: { $regex: search, $options: 'i' } },
{ dollarAmount: { $regex: search, $options: 'i' } },
{ trackingNumber: { $regex: search, $options: 'i' } },
{ amount: { $regex: search } },
{ dollarAmount: { $regex: search } },
{ trackingNumber: { $regex: search } },
],
}).skip(page).limit(rows).sort({ created_at: -1 });
const total = Math.ceil((await Withdraw.countDocuments({ userId: req.user_id })))