From fdd5cf718b2952c7dc145bbcd55211a019d365d1 Mon Sep 17 00:00:00 2001 From: sumanvpacewisdom Date: Tue, 12 Mar 2024 16:55:28 +0530 Subject: [PATCH] Issue fix for story - 1292 Mentor not able to start session after updating the session. --- src/services/sessions.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/services/sessions.js b/src/services/sessions.js index e1e282ef1..b244a6acf 100644 --- a/src/services/sessions.js +++ b/src/services/sessions.js @@ -524,6 +524,11 @@ module.exports = class SessionsHelper { await this.removeMentees(sessionId, menteesToRemove, bodyData.time_zone) } } + + if (bodyData.start_date !== Number(sessionDetail.start_date)) { + await sessionQueries.updateOne({ id: sessionId }, { status: common.PUBLISHED_STATUS }) + } + const { rowsAffected, updatedRows } = await sessionQueries.updateOne({ id: sessionId }, bodyData, { returning: true, })