|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|