Create masquerade widget component

on the Staff Instructor Toolbar
This commit is contained in:
stvn
2020-05-07 14:08:43 -07:00
parent 5ffc1bc599
commit dee5128448
6 changed files with 181 additions and 2 deletions

View File

@@ -227,6 +227,18 @@ export async function getResumeBlock(courseId) {
return camelCaseObject(data);
}
export async function getMasqueradeOptions(courseId) {
const url = new URL(`${getConfig().LMS_BASE_URL}/courses/${courseId}/masquerade`);
const { data } = await getAuthenticatedHttpClient().get(url.href, {});
return camelCaseObject(data);
}
export async function postMasqueradeOptions(courseId, data) {
const url = new URL(`${getConfig().LMS_BASE_URL}/courses/${courseId}/masquerade`);
const { response } = await getAuthenticatedHttpClient().post(url.href, data);
return camelCaseObject(response);
}
export async function updateCourseDeadlines(courseId) {
const url = new URL(`${getConfig().LMS_BASE_URL}/api/course_experience/v1/reset_course_deadlines`);
await getAuthenticatedHttpClient().post(url.href, { course_key: courseId });