fix: fixed course detail api params (#226)
* fix: fixed course detail api params * test: fixed tests
This commit is contained in:
@@ -9,9 +9,9 @@ function normalizeCourseDetail(data) {
|
||||
};
|
||||
}
|
||||
|
||||
export async function getCourseDetail(courseId) {
|
||||
export async function getCourseDetail(courseId, username) {
|
||||
const { data } = await getAuthenticatedHttpClient()
|
||||
.get(`${getConfig().LMS_BASE_URL}/api/courses/v1/courses/${courseId}`);
|
||||
.get(`${getConfig().LMS_BASE_URL}/api/courses/v1/courses/${courseId}?username=${username}`);
|
||||
|
||||
return normalizeCourseDetail(data);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ export function fetchCourseDetail(courseId) {
|
||||
dispatch(updateStatus({ courseId, status: LOADING }));
|
||||
|
||||
try {
|
||||
const courseDetail = await getCourseDetail(courseId);
|
||||
const courseDetail = await getCourseDetail(courseId, getAuthenticatedUser().username);
|
||||
dispatch(updateStatus({ courseId, status: LOADED }));
|
||||
|
||||
dispatch(addModel({ modelType: 'courseDetails', model: courseDetail }));
|
||||
|
||||
Reference in New Issue
Block a user