From 74c5202f9d4848267c4e20ca042e5ab8cfbd2e65 Mon Sep 17 00:00:00 2001 From: varun Date: Tue, 8 Aug 2023 02:50:00 -0400 Subject: [PATCH] made changes in iot create data --- src/controllers/tanksController.js | 1 + src/routes/tanksRoute.js | 1 + 2 files changed, 2 insertions(+) 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, });