diff --git a/src/course-home/data/api.js b/src/course-home/data/api.js index 46155d1ffc..e4c0d1849a 100644 --- a/src/course-home/data/api.js +++ b/src/course-home/data/api.js @@ -208,10 +208,6 @@ export async function getDatesTabData(courseId) { return camelCaseObject(data); } catch (error) { const { httpErrorStatus } = error && error.customAttributes; - if (httpErrorStatus === 404) { - global.location.replace(`${getConfig().LMS_BASE_URL}/courses/${courseId}/dates`); - return {}; - } if (httpErrorStatus === 401) { // The backend sends this for unenrolled and unauthenticated learners, but we handle those cases by examining // courseAccess in the metadata call, so just ignore this status for now. @@ -328,21 +324,9 @@ export function getTimeOffsetMillis(headerDate, requestTime, responseTime) { export async function getOutlineTabData(courseId) { const url = `${getConfig().LMS_BASE_URL}/api/course_home/outline/${courseId}`; - let { tabData } = {}; - let requestTime = Date.now(); - let responseTime = requestTime; - try { - requestTime = Date.now(); - tabData = await getAuthenticatedHttpClient().get(url); - responseTime = Date.now(); - } catch (error) { - const { httpErrorStatus } = error && error.customAttributes; - if (httpErrorStatus === 404) { - global.location.replace(`${getConfig().LMS_BASE_URL}/courses/${courseId}/course/`); - return {}; - } - throw error; - } + const requestTime = Date.now(); + const tabData = await getAuthenticatedHttpClient().get(url); + const responseTime = Date.now(); const { data, diff --git a/src/course-home/dates-tab/DatesTab.test.jsx b/src/course-home/dates-tab/DatesTab.test.jsx index 2eceeafb9e..dc03dcf046 100644 --- a/src/course-home/dates-tab/DatesTab.test.jsx +++ b/src/course-home/dates-tab/DatesTab.test.jsx @@ -341,12 +341,12 @@ describe('DatesTab', () => { it('redirects to the home page when unauthenticated', async () => { await renderDenied('authentication_required'); - expect(global.location.href).toEqual(`http://localhost/redirect/course-home/${courseMetadata.id}`); + expect(global.location.href).toEqual(`http://localhost/course/${courseMetadata.id}/home`); }); it('redirects to the home page when unenrolled', async () => { await renderDenied('enrollment_required'); - expect(global.location.href).toEqual(`http://localhost/redirect/course-home/${courseMetadata.id}`); + expect(global.location.href).toEqual(`http://localhost/course/${courseMetadata.id}/home`); }); }); }); diff --git a/src/course-home/progress-tab/grades/detailed-grades/DetailedGrades.jsx b/src/course-home/progress-tab/grades/detailed-grades/DetailedGrades.jsx index 49200715a5..8a7f45508d 100644 --- a/src/course-home/progress-tab/grades/detailed-grades/DetailedGrades.jsx +++ b/src/course-home/progress-tab/grades/detailed-grades/DetailedGrades.jsx @@ -1,7 +1,6 @@ import React from 'react'; import { useSelector } from 'react-redux'; -import { getConfig } from '@edx/frontend-platform'; import { sendTrackEvent } from '@edx/frontend-platform/analytics'; import { getAuthenticatedUser } from '@edx/frontend-platform/auth'; import { FormattedMessage, injectIntl, intlShape } from '@edx/frontend-platform/i18n'; @@ -41,7 +40,7 @@ function DetailedGrades({ intl }) { diff --git a/src/course-home/progress-tab/related-links/RelatedLinks.jsx b/src/course-home/progress-tab/related-links/RelatedLinks.jsx index 2759ceb38b..ac514d0d6b 100644 --- a/src/course-home/progress-tab/related-links/RelatedLinks.jsx +++ b/src/course-home/progress-tab/related-links/RelatedLinks.jsx @@ -1,7 +1,6 @@ import React from 'react'; import { useSelector } from 'react-redux'; -import { getConfig } from '@edx/frontend-platform'; import { sendTrackEvent } from '@edx/frontend-platform/analytics'; import { getAuthenticatedUser } from '@edx/frontend-platform/auth'; import { injectIntl, intlShape } from '@edx/frontend-platform/i18n'; @@ -33,13 +32,13 @@ function RelatedLinks({ intl }) {

{intl.formatMessage(messages.relatedLinks)}