diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index aee0a795..fd8bc038 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -1026,6 +1026,7 @@ exports.IotDevice = async (req, reply) => { // } // } + exports.getIotD = async (req, reply) => { try { const latestRecords = await IotData.find({ hardwareId: req.query.hardwareId }) diff --git a/src/routes/tanksRoute.js b/src/routes/tanksRoute.js index 5a789e9c..0a29c483 100644 --- a/src/routes/tanksRoute.js +++ b/src/routes/tanksRoute.js @@ -383,6 +383,7 @@ module.exports = function (fastify, opts, next) { }, ], }, + //preHandler: fastify.auth([fastify.authenticate]), handler: tanksController.getIotD, });