From 0d905f9f0d35e161d0b3eed020fb6cc185830f97 Mon Sep 17 00:00:00 2001 From: Farhaan Bukhsh Date: Sat, 28 Dec 2024 02:45:17 +0530 Subject: [PATCH] fixup! feat: Adding human readable 403 error access restricted --- src/course-outline/page-alerts/PageAlerts.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/course-outline/page-alerts/PageAlerts.jsx b/src/course-outline/page-alerts/PageAlerts.jsx index 7dc50010a..2dc984202 100644 --- a/src/course-outline/page-alerts/PageAlerts.jsx +++ b/src/course-outline/page-alerts/PageAlerts.jsx @@ -344,7 +344,11 @@ const PageAlerts = ({ let errorList = Object.entries(errors).filter(obj => obj[1] !== null).map(([k, v]) => { switch (v.type) { case API_ERROR_TYPES.serverError: { - let description = v.data || intl.formatMessage(messages.serverErrorAlertBody); + let description = ( + + {v.data || intl.formatMessage(messages.serverErrorAlertBody)} + + ); let alertTitle = intl.formatMessage(messages.serverErrorAlert); if (v.status === 403) { description = intl.formatMessage(messages.forbiddenAlertBody, { @@ -395,8 +399,7 @@ const PageAlerts = ({ dismissError={() => dispatch(dismissError(msgObj.key))} > {msgObj.title} - {(typeof msgObj.desc === 'string') - ? {msgObj.desc} : msgObj.desc} + {msgObj.desc} ) : ( {msgObj.title} - {msgObj.desc && {msgObj.desc}} + {msgObj.desc} ) ))