From 445eab17767533090b5235ccd585261f763a4d72 Mon Sep 17 00:00:00 2001 From: Varun Date: Tue, 4 Mar 2025 14:37:50 +0530 Subject: [PATCH] get quotations for store --- src/controllers/storeController.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/controllers/storeController.js b/src/controllers/storeController.js index 2a1fd6fb..3f1c9a22 100644 --- a/src/controllers/storeController.js +++ b/src/controllers/storeController.js @@ -1425,16 +1425,14 @@ exports.getbatchnumbers = async (req, reply) => { exports.getbatquotationsforparticularstore = async (req, reply) => { try { const storeId = req.params.storeId; - let type = req.params.type ? req.params.type.toLowerCase() : null; // Convert type to uppercase + let query = { storeId: storeId }; - if (type !== "ALL") { - query.type = type; - } + // Fetch data based on the query - const result = await Insensors.find(query); + const result = await SensorQuotation.find(query); if (!result ) { return reply.send({ status_code: 404, error: "not found" }); @@ -1544,7 +1542,7 @@ exports.createquotationforSensor = async (req, reply) => { quatationId, customerId, surveyId, - quote_status: "sentfrominstaller", + quote_status: "sentfromsurvey", masters, slaves, sensors,