feat: added waffle flag state for Courseware Search (#1199)

This commit is contained in:
Marcos
2023-10-12 16:06:00 -03:00
committed by GitHub
parent 165097d061
commit 62465ec956
8 changed files with 141 additions and 0 deletions

View File

@@ -445,3 +445,9 @@ export async function unsubscribeFromCourseGoal(token) {
return getAuthenticatedHttpClient().post(url.href)
.then(res => camelCaseObject(res));
}
export async function getCoursewareSearchEnabledFlag(courseId) {
const url = new URL(`${getConfig().LMS_BASE_URL}/courses/${courseId}/courseware-search/enabled/`);
const { data } = await getAuthenticatedHttpClient().get(url.href);
return { enabled: data.enabled || false };
}