Files
frontend-app-communications/src/components/page-container/data/api.js
Justin Hynes 1477460abc feat: suggested UI improvements from bugbash
[MICROBA-1743]

* Use `LearningHeader` component which can display the course information (title, org, number) in the header to the learner (matching existing design).
* Refactor components to introduce a `PageContainer` component in order to support displaying course information in header.
* Refactor the BulkEmailTool component to take advantage of the new course metadata context provider.
* Add tests for new `PageContainer` component.
* Fix existing tests due to refactor.
* Add "Email" label above recipient selection checkboxes to match existing design.
2022-03-11 11:35:00 -05:00

17 lines
650 B
JavaScript

import { getConfig } from '@edx/frontend-platform';
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
const courseHomeBaseUrl = `${getConfig().LMS_BASE_URL}/api/course_home/v1/course_metadata`;
export async function getCourseHomeCourseMetadata(courseId) {
const courseHomeMetadataUrl = `${courseHomeBaseUrl}/${courseId}`;
const { data } = await getAuthenticatedHttpClient().get(courseHomeMetadataUrl);
return data;
}
export async function getCohorts(courseId) {
const url = `${getConfig().LMS_BASE_URL}/courses/${courseId}/cohorts/`;
const { data } = await getAuthenticatedHttpClient().get(url);
return data;
}