diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 90b33f0b..0aefd7cb 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -972,6 +972,7 @@ exports.IotDevice = async (req, reply) => { tankHeight: tank.tankHeight, maxLevel: tank.maxLevel, minLevel: tank.minLevel + })); // create a new IOttank document with the provided data diff --git a/src/models/tanks.js b/src/models/tanks.js index f66a2033..2b279362 100644 --- a/src/models/tanks.js +++ b/src/models/tanks.js @@ -107,3 +107,4 @@ const IotData = mongoose.model("IotData", IOttankSchema); module.exports = { Tank, MotorData,IotData } + diff --git a/src/routes/tanksRoute.js b/src/routes/tanksRoute.js index 920c65d6..f3a84719 100644 --- a/src/routes/tanksRoute.js +++ b/src/routes/tanksRoute.js @@ -366,6 +366,7 @@ module.exports = function (fastify, opts, next) { handler: tanksController.IotDevice }); + fastify.get("/api/APIRead", { schema: {