Fix options
This commit is contained in:
@@ -61,7 +61,7 @@ module.exports.getAllForUser = async (req, res) => {
|
|||||||
const data = await InstalledDevice.find({
|
const data = await InstalledDevice.find({
|
||||||
userId: req.user_id,
|
userId: req.user_id,
|
||||||
$or: [
|
$or: [
|
||||||
{ IMEI: { $regex: search, $options: 'i' } },
|
{ IMEI: { $regex: search } },
|
||||||
],
|
],
|
||||||
}).skip(page).limit(rows).sort({ created_at: -1 }).populate('deviceId')
|
}).skip(page).limit(rows).sort({ created_at: -1 }).populate('deviceId')
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ module.exports.getAllForAdmin = async (req, res) => {
|
|||||||
|
|
||||||
const data = await InstalledDevice.find({
|
const data = await InstalledDevice.find({
|
||||||
$or: [
|
$or: [
|
||||||
{ IMEI: { $regex: search, $options: 'i' } },
|
{ IMEI: { $regex: search } },
|
||||||
]
|
]
|
||||||
}).sort({ status: 1 }).skip(page).limit(rows)
|
}).sort({ status: 1 }).skip(page).limit(rows)
|
||||||
.populate('deviceId')
|
.populate('deviceId')
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ module.exports.getAll = async (req, res) => {
|
|||||||
const score = await Score.find({
|
const score = await Score.find({
|
||||||
userId: req.user_id,
|
userId: req.user_id,
|
||||||
$or: [
|
$or: [
|
||||||
{ title: { $regex: search, $options: 'i' } },
|
{ title: { $regex: search } },
|
||||||
{ score: { $regex: search, $options: 'i' } },
|
{ score: { $regex: search } },
|
||||||
],
|
],
|
||||||
}).skip(page).limit(rows);
|
}).skip(page).limit(rows);
|
||||||
const total = Math.ceil((await Score.countDocuments({ userId: req.user_id })))
|
const total = Math.ceil((await Score.countDocuments({ userId: req.user_id })))
|
||||||
|
|||||||
@@ -64,9 +64,9 @@ module.exports.getAllForUser = async (req, res) => {
|
|||||||
const data = await Withdraw.find({
|
const data = await Withdraw.find({
|
||||||
userId: req.user_id,
|
userId: req.user_id,
|
||||||
$or: [
|
$or: [
|
||||||
{ amount: { $regex: search, $options: 'i' } },
|
{ amount: { $regex: search } },
|
||||||
{ dollarAmount: { $regex: search, $options: 'i' } },
|
{ dollarAmount: { $regex: search } },
|
||||||
{ trackingNumber: { $regex: search, $options: 'i' } },
|
{ trackingNumber: { $regex: search } },
|
||||||
],
|
],
|
||||||
}).skip(page).limit(rows).sort({ created_at: -1 });
|
}).skip(page).limit(rows).sort({ created_at: -1 });
|
||||||
const total = Math.ceil((await Withdraw.countDocuments({ userId: req.user_id })))
|
const total = Math.ceil((await Withdraw.countDocuments({ userId: req.user_id })))
|
||||||
|
|||||||
Reference in New Issue
Block a user