From 6f25b8dc4e4bb67ef40c4548a21a33e49a9e2db9 Mon Sep 17 00:00:00 2001 From: suvarnakale Date: Wed, 27 Nov 2024 14:15:13 +0530 Subject: [PATCH] Issue #PS-2679 bug: Not able to update recurring session- fix --- src/components/PlannedSession.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/components/PlannedSession.tsx b/src/components/PlannedSession.tsx index 1f902105..d2d0da44 100644 --- a/src/components/PlannedSession.tsx +++ b/src/components/PlannedSession.tsx @@ -1134,7 +1134,19 @@ const PlannedSession: React.FC = ({ 'success' ); } else { - showToastMessage(t('COMMON.SOMETHING_WENT_WRONG'), 'error'); + if (response?.response?.data?.params?.errmsg) { + const errMsg = response?.response?.data?.params?.errmsg; + let errorMessage; + if (typeof errMsg === 'string') { + console.log(errMsg); + errorMessage = errMsg; + } else { + errorMessage = errMsg[0] + ' and ' + errMsg[1]; + } + showToastMessage(errorMessage, 'error'); + } else { + showToastMessage(t('COMMON.SOMETHING_WENT_WRONG'), 'error'); + } } if (onEventUpdated) { onEventUpdated(); @@ -1515,8 +1527,8 @@ const PlannedSession: React.FC = ({ // block?.selectedWeekDays?.join(', ') || // editSession?.recurrencePattern?.daysOfWeek, days: - block?.selectedWeekDays?.join(', ') || - (editSession?.recurrencePattern?.daysOfWeek || []) + block?.selectedWeekDays?.join(', ') ?? + (editSession?.recurrencePattern?.daysOfWeek) .map( (dayIndex: any) => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][