create iot data

master
varun 2 years ago
parent cb7bdf9c2a
commit f820e98db9

@ -982,7 +982,6 @@ exports.IotDevice = async (req, reply) => {
// save the document to MongoDB // save the document to MongoDB
await ottank.save(); await ottank.save();
// get the latest document sorted in descending order of date and time // get the latest document sorted in descending order of date and time
const latestOttank = await IotData.findOne({ hardwareId }).sort({ date: -1, time: -1 }); const latestOttank = await IotData.findOne({ hardwareId }).sort({ date: -1, time: -1 });

@ -355,6 +355,7 @@ module.exports = function (fastify, opts, next) {
} }
} }
}, },
required: ["hardwareId", "mode", "tanks"] required: ["hardwareId", "mode", "tanks"]
}, },
security: [ security: [

Loading…
Cancel
Save