Fix issue with shared report API
This commit is contained in:
parent
5b1981f78c
commit
2875f5a66c
@ -72,9 +72,9 @@ router.get('/', async (req, res) => {
|
|||||||
|
|
||||||
router.get('/shared_report', cors({ origin: 'https://auto.aliencat.pro' }), async (req, res) => {
|
router.get('/shared_report', cors({ origin: 'https://auto.aliencat.pro' }), async (req, res) => {
|
||||||
try {
|
try {
|
||||||
let { plate_number } = jwt.verify(req.query.token, '#TheTruthIsOutThere');
|
let { plateNumber } = jwt.verify(req.query.token, '#TheTruthIsOutThere');
|
||||||
let collection = req.db.collection('vehicles');
|
let collection = req.db.collection('vehicles');
|
||||||
let vehicles = await collection.find({ plate_number }).toArray();
|
let vehicles = await collection.find({ number: plateNumber }).toArray();
|
||||||
if(vehicles.length > 0) {
|
if(vehicles.length > 0) {
|
||||||
res.send({ success: true, data: vehicles[0] });
|
res.send({ success: true, data: vehicles[0] });
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user