AA-213: Redirect progress tab to legacy (#384)

This commit is contained in:
Carla Duarte
2021-03-11 15:46:37 -05:00
committed by GitHub
parent 6e2294e279
commit e3d9ff9ed3

View File

@@ -124,18 +124,20 @@ export async function getDatesTabData(courseId) {
}
export async function getProgressTabData(courseId) {
const url = `${getConfig().LMS_BASE_URL}/api/course_home/v1/progress/${courseId}`;
try {
const { data } = await getAuthenticatedHttpClient().get(url);
return camelCaseObject(data);
} catch (error) {
const { httpErrorStatus } = error && error.customAttributes;
if (httpErrorStatus === 404) {
global.location.replace(`${getConfig().LMS_BASE_URL}/courses/${courseId}/progress`);
return {};
}
throw error;
}
global.location.replace(`${getConfig().LMS_BASE_URL}/courses/${courseId}/progress`);
// TODO: (AA-213) update once flag is in place
// const url = `${getConfig().LMS_BASE_URL}/api/course_home/v1/progress/${courseId}`;
// try {
// const { data } = await getAuthenticatedHttpClient().get(url);
// return camelCaseObject(data);
// } catch (error) {
// const { httpErrorStatus } = error && error.customAttributes;
// if (httpErrorStatus === 404) {
// global.location.replace(`${getConfig().LMS_BASE_URL}/courses/${courseId}/progress`);
// return {};
// }
// throw error;
// }
}
export async function getProctoringInfoData(courseId) {