Files
frontend-app-communications/src/components/bulk-email-tool/data/api.js
Thomas Tracy ce9cdf642b feat: [MICROBA-1620] Wire BulkEmailForm to API (#11)
- 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
2022-01-27 14:51:17 -05:00

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;
}