fix: [AA-1206] resolve access APIs (#838)
* fix: [AA-1206] resolve access APIs As part of eliminating redundant fields course_access was removed from the Courseware metadata API. There are some differences between the two APIs - courseware returned an error if the course had flags preventing it from being loaded in the MFE, and courseHome had a second field, can_load_courseware, that returned a boolean. This fix unifies the handling of the access fields to behave consistently.
This commit is contained in:
@@ -93,7 +93,9 @@ export function fetchCourse(courseId) {
|
||||
logError(courseHomeMetadataResult.reason);
|
||||
}
|
||||
if (fetchedMetadata && fetchedCourseHomeMetadata) {
|
||||
if (courseHomeMetadataResult.value.courseAccess.hasAccess && fetchedOutline) {
|
||||
if (courseHomeMetadataResult.value.courseAccess.hasAccess
|
||||
&& courseHomeMetadataResult.value.canLoadCourseware
|
||||
&& fetchedOutline) {
|
||||
// User has access
|
||||
dispatch(fetchCourseSuccess({ courseId }));
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user