Apply filters to interventions report

JIRA:EDUCATOR-4537
This commit is contained in:
Matt Hughes
2019-08-16 14:02:06 -04:00
parent d5b3edc850
commit ec08ef4bcb
2 changed files with 22 additions and 4 deletions

View File

@@ -103,9 +103,14 @@ class LmsApiService {
return `${LmsApiService.baseUrl}/api/bulk_grades/course/${courseId}/?${queryParams}`;
}
static getInterventionExportCsvUrl(courseId) {
const downloadUrl = `${LmsApiService.baseUrl}/api/bulk_grades/course/${courseId}/intervention`;
return downloadUrl;
static getInterventionExportCsvUrl(courseId, options = {}) {
const queryParams = ['track', 'cohort', 'assignment', 'assignmentType', 'assignmentGradeMax',
'assignmentGradeMin', 'courseGradeMin', 'courseGradeMax']
.filter(opt => options[opt] &&
options[opt] !== 'All')
.map(opt => `${opt}=${encodeURIComponent(options[opt])}`)
.join('&');
return `${LmsApiService.baseUrl}/api/bulk_grades/course/${courseId}/intervention?${queryParams}`;
}
static getGradeImportCsvUrl = LmsApiService.getGradeExportCsvUrl;