fix bug
This commit is contained in:
@@ -96,6 +96,27 @@ module.exports.notifyAdmin = async type => {
|
||||
const admin = io.of('/admin')
|
||||
const data = { type }
|
||||
|
||||
if (type === 'newAwardRequest') {
|
||||
const newCustomers = await AwardRequest.countDocuments({ status: 0 })
|
||||
|
||||
data.newCustomers = newCustomers.length
|
||||
}
|
||||
if (type === 'newInstallDeviceRequest') {
|
||||
const newCustomers = await InstalledDevice.countDocuments({ status: 0 })
|
||||
|
||||
data.newCustomers = newCustomers.length
|
||||
}
|
||||
|
||||
if (type === 'newWithdrawRequest') {
|
||||
const newCustomers = await Withdraw.countDocuments({ status: 0 })
|
||||
|
||||
data.newCustomers = newCustomers.length
|
||||
}
|
||||
if (type === 'pendingUsers') {
|
||||
const newCustomers = await UserGPS.countDocuments({ active: false })
|
||||
|
||||
data.newCustomers = newCustomers.length
|
||||
}
|
||||
if (type === 'updateNewCustomers') {
|
||||
const newCustomers = await User.find({ scope: ['user'], seenByAdmin: false })
|
||||
data.newCustomers = newCustomers.length
|
||||
|
||||
Reference in New Issue
Block a user