fix: build the course id properly when the MFE is deployed in a subdirectory

This commit is contained in:
Jhony Avella
2021-11-07 22:57:00 -05:00
parent 45b922d6e6
commit 7fd06c2373

View File

@@ -5,7 +5,7 @@ import { filterQuery, stringifyUrl } from './utils';
const baseUrl = `${configuration.LMS_BASE_URL}`;
const courseId = window.location.pathname.slice(1);
const courseId = window.location.pathname.split('/').filter(Boolean).pop() || '';
const api = `${baseUrl}/api/`;
const bulkGrades = `${api}bulk_grades/course/${courseId}/`;