master^2
Varun 7 months ago
parent 268e04b8ec
commit 9b77ef5728

@ -1947,7 +1947,7 @@ exports.getquotationofinstalleranduser = async (req, reply) => {
exports.updateInstallationId = async (req, reply) => { exports.updateInstallationId = async (req, reply) => {
try { try {
const { orderId } = req.params; const { _id } = req.params;
const { installationId } = req.body; const { installationId } = req.body;
if (!orderId || !installationId) { if (!orderId || !installationId) {
@ -1956,7 +1956,7 @@ exports.updateInstallationId = async (req, reply) => {
// Update the order with the new installationId // Update the order with the new installationId
const updatedOrder = await Order.findByIdAndUpdate( const updatedOrder = await Order.findByIdAndUpdate(
orderId, _id,
{ installationId, updated_at: new Date().toISOString() }, // Also update the timestamp { installationId, updated_at: new Date().toISOString() }, // Also update the timestamp
{ new: true } // Return the updated document { new: true } // Return the updated document
); );

Loading…
Cancel
Save