diff --git a/src/controllers/storeController.js b/src/controllers/storeController.js index 53cbbd14..51fa7d4b 100644 --- a/src/controllers/storeController.js +++ b/src/controllers/storeController.js @@ -2236,6 +2236,7 @@ exports.acceptQuotation = async (req, reply) => { // Find the quotation by ID const quotation = await SensorQuotation.findOne({ quatationId: quotationId }); + console.log(quotation,"quotation") if (!quotation) { return reply.status(404).send({ error: "Quotation not found" }); @@ -2250,6 +2251,7 @@ exports.acceptQuotation = async (req, reply) => { }); } else if (action === "accept") { const { customerId, masters, slaves, sensors, master_connections } = quotation; + console.log(customerId,masters,slaves,sensors,master_connections) // Convert quotation to an order object and include storeId const newOrder = new Order({ diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 90200406..3391fcf1 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -6120,14 +6120,14 @@ async function processIotData(hw_Id, data) { await iotTankData.save(); // Delete excess records (keep only the latest three records) - const recordsToKeep = 3; - const recordsToDelete = await IotData.find({ hardwareId: hw_Id }) - .sort({ date: -1, time: -1 }) - .skip(recordsToKeep); + // const recordsToKeep = 3; + // const recordsToDelete = await IotData.find({ hardwareId: hw_Id }) + // .sort({ date: -1, time: -1 }) + // .skip(recordsToKeep); - for (const record of recordsToDelete) { - await record.remove(); - } + // for (const record of recordsToDelete) { + // await record.remove(); + // } // Process each tank for (const tank of tanks) {