get all quotations

master
Varun 1 year ago
parent 6a2b9b88e5
commit 4557230e6b

@ -1098,7 +1098,7 @@ exports.createquotationforSensor = async (req, reply) => {
const savedQuotation = await newQuotation.save();
// Send a success response with the saved document
reply.code(201).send({
reply.code(200).send({
success: true,
message: 'Quotation for sensors created successfully.',
data: savedQuotation,
@ -1114,6 +1114,20 @@ exports.createquotationforSensor = async (req, reply) => {
}
};
exports.getallquotationdata = async (req, reply) => {
try {
await SensorQuotation.find({})
.exec()
.then((docs) => {
reply.send({ status_code: 200, data: docs, count: docs.length });
})
.catch((err) => {
console.log(err);
reply.send({ error: err });
});
} catch (err) {
throw boom.boomify(err);
}
};

@ -802,5 +802,21 @@ fastify.post("/api/createquotationforSensor/:installationId", {
})
fastify.get("/api/getallquotationdata", {
schema: {
tags: ["Install"],
description: "This is for Get All Quotation Data",
summary: "This is for to Get All Quotation Data",
security: [
{
basicAuth: [],
},
],
},
// preHandler: fastify.auth([fastify.authenticate]),
handler: storeController.getallquotationdata,
});
next();
};

Loading…
Cancel
Save