Skip to content

Commit

Permalink
Issue #PS-2679 bug: Not able to update recurring session- fix
Browse files Browse the repository at this point in the history
  • Loading branch information
suvarnakale committed Nov 27, 2024
1 parent e68c23c commit 6f25b8d
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/components/PlannedSession.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,19 @@ const PlannedSession: React.FC<PlannedModalProps> = ({
'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();
Expand Down Expand Up @@ -1515,8 +1527,8 @@ const PlannedSession: React.FC<PlannedModalProps> = ({
// 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'][
Expand Down

0 comments on commit 6f25b8d

Please sign in to comment.