Fix populate
This commit is contained in:
@@ -48,7 +48,7 @@ module.exports.getAllForUser = async(req, res)=>{
|
||||
}
|
||||
|
||||
module.exports.getAllForAdmin = async(req, res)=>{
|
||||
const data = await InstalledDevice.find({}).sort({status: 1}).populate('deviceId userId')
|
||||
const data = await InstalledDevice.find({}).sort({status: 1}).populate('deviceId').populate('userId', 'shopName shopNumber shopAddress birthDate score first_name last_name profilePic')
|
||||
res.status(200).json(data)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user