fix: build the course id properly when the MFE is deployed in a subdirectory (#213)

This commit is contained in:
Jhony Avella
2021-12-21 10:38:58 -05:00
committed by GitHub
parent 9e04813d06
commit 5fe80b4a52

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