From d945c74786790dfebc9514d5f1fe4eedb1bc52b6 Mon Sep 17 00:00:00 2001 From: Bhaskar Date: Wed, 17 Sep 2025 11:55:15 +0530 Subject: [PATCH] description added in insensors/media --- src/controllers/installationController.js | 5 ++++- src/models/store.js | 2 ++ src/routes/installationRoute.js | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/controllers/installationController.js b/src/controllers/installationController.js index ba3f1d40..549d6081 100644 --- a/src/controllers/installationController.js +++ b/src/controllers/installationController.js @@ -1969,7 +1969,7 @@ exports.addMediaToInsensor = async (req, reply) => { // const { hardwareId, customerId, type } = req.params; // const { video, material, workStatus, product_status } = req.body; const { customerId } = req.params; - const { hardwareId, type, video, material, workStatus, product_status } = req.body; + const { hardwareId, type, video, material, workStatus, product_status,description } = req.body; if (!hardwareId || !customerId || !type) { @@ -2001,6 +2001,9 @@ exports.addMediaToInsensor = async (req, reply) => { if (product_status && ['pending', 'complete'].includes(product_status)) { insensor.product_status = product_status; } + if (description) { + insensor.description = description; + } await insensor.save(); diff --git a/src/models/store.js b/src/models/store.js index ab242eba..2650e7d4 100644 --- a/src/models/store.js +++ b/src/models/store.js @@ -792,6 +792,8 @@ workStatusPictures: [ enum: ['pending', 'complete'], default: 'pending' }, + description: { type: String }, + }); diff --git a/src/routes/installationRoute.js b/src/routes/installationRoute.js index 9c06e1bd..7ab00c44 100644 --- a/src/routes/installationRoute.js +++ b/src/routes/installationRoute.js @@ -629,7 +629,9 @@ fastify.post( type: 'string', enum: ['pending', 'complete'], description: 'Optional: update product_status' - } + }, + description: { type: 'string' }, + }, // at least one of video, material, workStatus required