- Wires up the BulkEmailForm to be able to actually send email tasks to the instructor api - Adds testing for the BulkEmailForm, as well as BulkEmailTool itself - Does some cleanup, and adds some additional testing tools as needed
17 lines
724 B
JavaScript
17 lines
724 B
JavaScript
import { getConfig } from '@edx/frontend-platform';
|
|
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
|
|
|
|
const InstructorApiBaseUrl = `${getConfig().LMS_BASE_URL}/api/instructor/v1`;
|
|
const courseHomeBaseUrl = `${getConfig().LMS_BASE_URL}/api/course_home/v1/course_metadata`;
|
|
|
|
export default async function getInstructorData(courseId) {
|
|
const InstructorApiUrl = `${InstructorApiBaseUrl}/tasks/${courseId} `;
|
|
return getAuthenticatedHttpClient().get(InstructorApiUrl);
|
|
}
|
|
|
|
export async function getCourseHomeCourseMetadata(courseId) {
|
|
const courseHomeMetadataUrl = `${courseHomeBaseUrl}/${courseId}`;
|
|
const { data } = await getAuthenticatedHttpClient().get(courseHomeMetadataUrl);
|
|
return data;
|
|
}
|