diff --git a/src/controllers/installationController.js b/src/controllers/installationController.js index 038b4964..5838509d 100644 --- a/src/controllers/installationController.js +++ b/src/controllers/installationController.js @@ -6228,8 +6228,8 @@ exports.StatusTeamMember = async (request, reply) => { exports.updateComments = async (req, reply) => { try { - const { supportId, customerId, hardwareId } = req.params; - const { comments } = req.body; + const { supportId} = req.params; + const { comments, customerId, hardwareId } = req.body; if (!supportId || !customerId || !hardwareId) { return reply.code(400).send({ error: "supportId, customerId and hardwareId are required in path params" }); diff --git a/src/routes/installationRoute.js b/src/routes/installationRoute.js index a9445011..c43a3833 100644 --- a/src/routes/installationRoute.js +++ b/src/routes/installationRoute.js @@ -562,7 +562,7 @@ module.exports = function (fastify, opts, next) { }, handler: installationController.getDisconnectedIssuesBySupportId, }); - fastify.put('/api/updateComments/:supportId/:customerId/:hardwareId', { + fastify.put('/api/updateComments/:supportId', { schema: { description: "Update comments for a support record issue", tags: ["Support"], @@ -571,14 +571,15 @@ module.exports = function (fastify, opts, next) { required: ["supportId", "customerId", "hardwareId"], properties: { supportId: { type: "string", minLength: 1 }, - customerId: { type: "string", minLength: 1 }, - hardwareId: { type: "string", minLength: 1 } + } }, body: { type: "object", required: ["comments"], properties: { + customerId: { type: "string", minLength: 1 }, + hardwareId: { type: "string", minLength: 1 }, comments: { type: "string", minLength: 1 } } },