diff --git a/src/controllers/storeController.js b/src/controllers/storeController.js index f7239cdc..eb6896ef 100644 --- a/src/controllers/storeController.js +++ b/src/controllers/storeController.js @@ -10,7 +10,7 @@ const fastify = require("fastify")({ return uuidv4(); }, }); -const { Install, ProfilePictureInstall, SensorQuotation,generateinstallationId,Store,WaterLeverSensor,MotorSwitchSenso,Insensors,generatequatationId, HardwareCart, ServiceCart, Sales} = require("../models/store"); +const {Iotprice, Install, ProfilePictureInstall, SensorQuotation,generateinstallationId,Store,WaterLeverSensor,MotorSwitchSenso,Insensors,generatequatationId, HardwareCart, ServiceCart, Sales} = require("../models/store"); const { User,Counter, generateBookingId,resetCounter,generateCustomerId,ProfilePicture} = require('../models/User') @@ -1585,7 +1585,7 @@ exports.createEstimationPrice = async (req, reply) => { const { name, type, quantity } = item; // Fetch the unit price from IotPrice collection - const priceEntry = await IotPrice.findOne({ name, type }); + const priceEntry = await Iotprice.findOne({ name, type }); if (!priceEntry) { itemDetails.push({ diff --git a/src/routes/storeRoute.js b/src/routes/storeRoute.js index 2ec56e7e..a639325a 100644 --- a/src/routes/storeRoute.js +++ b/src/routes/storeRoute.js @@ -1335,7 +1335,7 @@ fastify.post("/api/createEstimationPrice", { required: ["items"] } }, - handler: estimationController.createEstimationPrice + handler: storeController.createEstimationPrice }); fastify.post("/api/editQuotationForSensor/:quatationId", {