* feat: Make "Pages & Resources" course apps into plugins * feat: move ora_settings * feat: move proctoring * feat: move progress * feat: move teams * feat: move wiki * feat: move Xpert settings * fix: add webpack.prod.config.js * fix: clean up unused parts of package.json files * feat: Add an error message when displaying a Course App Plugin fails * chore: fix various eslint warnings * chore: fix jest tests * fix: error preventing "npm ci" from working * feat: better tests for <SettingsComponent> * chore: move xpert_unit_summary into same dir as other plugins * fix: eslint-import-resolver-webpack is a dev dependency * chore: move learning_assistant to be a plugin too * feat: for compatibility, install 2U plugins by default * fix: bug with learning_assistant package.json
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
import { getConfig } from '@edx/frontend-platform';
|
|
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
|
|
|
|
export function getXpertSettingsUrl(courseId) {
|
|
return `${getConfig().STUDIO_BASE_URL}/ai_aside/v1/${courseId}`;
|
|
}
|
|
|
|
export function getXpertConfigurationStatusUrl(courseId) {
|
|
return `${getConfig().STUDIO_BASE_URL}/ai_aside/v1/${courseId}/configurable`;
|
|
}
|
|
|
|
export async function getXpertSettings(courseId) {
|
|
const { data } = await getAuthenticatedHttpClient()
|
|
.get(getXpertSettingsUrl(courseId));
|
|
|
|
return data;
|
|
}
|
|
|
|
export async function postXpertSettings(courseId, state) {
|
|
const { data } = await getAuthenticatedHttpClient()
|
|
.post(getXpertSettingsUrl(courseId), {
|
|
enabled: state.enabled,
|
|
reset: state.reset,
|
|
});
|
|
|
|
return data;
|
|
}
|
|
|
|
export async function getXpertPluginConfigurable(courseId) {
|
|
const { data } = await getAuthenticatedHttpClient()
|
|
.get(getXpertConfigurationStatusUrl(courseId));
|
|
|
|
return data;
|
|
}
|
|
|
|
export async function deleteXpertSettings(courseId) {
|
|
const { data } = await getAuthenticatedHttpClient()
|
|
.delete(getXpertSettingsUrl(courseId));
|
|
|
|
return data;
|
|
}
|