get quotations for store

master^2
Varun 7 months ago
parent 51b01ec127
commit 445eab1776

@ -1425,16 +1425,14 @@ exports.getbatchnumbers = async (req, reply) => {
exports.getbatquotationsforparticularstore = async (req, reply) => { exports.getbatquotationsforparticularstore = async (req, reply) => {
try { try {
const storeId = req.params.storeId; const storeId = req.params.storeId;
let type = req.params.type ? req.params.type.toLowerCase() : null; // Convert type to uppercase
let query = { storeId: storeId }; let query = { storeId: storeId };
if (type !== "ALL") {
query.type = type;
}
// Fetch data based on the query // Fetch data based on the query
const result = await Insensors.find(query); const result = await SensorQuotation.find(query);
if (!result ) { if (!result ) {
return reply.send({ status_code: 404, error: "not found" }); return reply.send({ status_code: 404, error: "not found" });
@ -1544,7 +1542,7 @@ exports.createquotationforSensor = async (req, reply) => {
quatationId, quatationId,
customerId, customerId,
surveyId, surveyId,
quote_status: "sentfrominstaller", quote_status: "sentfromsurvey",
masters, masters,
slaves, slaves,
sensors, sensors,

Loading…
Cancel
Save