Fix populate

This commit is contained in:
Mr Swift
2024-08-06 19:07:47 +03:30
parent 7c45bb501d
commit 2870a0995b
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ module.exports.gpsRequest = [
module.exports.getAllRequest = [
async (req, res) => {
const data = await RequestGPS.find({}).sort({ status: 1 }).populate('userId')
const data = await RequestGPS.find({}).sort({ status: 1 }).populate('userId', 'shopName shopNumber shopAddress birthDate score first_name last_name profilePic')
res.status(200).json(data)
}
]
@@ -46,7 +46,7 @@ module.exports.getOneRequest = [
],
checkValidations(validationResult),
async (req, res) => {
const data = await RequestGPS.findById(req.params.id).populate('userId')
const data = await RequestGPS.findById(req.params.id).populate('userId', 'shopName shopNumber shopAddress birthDate score first_name last_name profilePic')
res.status(200).json(data)
}
]