This commit is contained in:
Mr Swift
2024-08-11 16:11:32 +03:30
parent 21a6907d9f
commit 180cb8b5cf
18 changed files with 192 additions and 100 deletions
+17
View File
@@ -89,6 +89,23 @@ module.exports.getOne = [
}
]
module.exports.getOneByIMEI = [
[
param('imei').notEmpty().isString().withMessage('ایدی اشتباه است')
],
checkValidations(validationResult),
async (req, res) => {
const data = await Device.findOne({IMEI:req.params.imei}).sort({ created_at: -1 })
if (!data) {
res.status(404).json(_sr.fa.not_found.item_id)
} else {
res.status(200).json(data)
}
}
]
module.exports.updateDevice = [
[