Skip to content

Commit b510b6f

Browse files
Faraz32123Muhammad Faraz  Maqsood
andauthored
fix: update advanced module list not working (#2189)
Backend was still expecting `{'advanced_modules', {'value': ['poll', 'problem-builder', 'h5pxblock']}}` but without this change, it was receiving `{'advancedModules', ['poll', 'problem-builder', 'h5pxblock']}` Follow up to #1581 Co-authored-by: Muhammad Faraz Maqsood <[email protected]>
1 parent 488173e commit b510b6f

File tree

1 file changed

+2
-1
lines changed
  • src/advanced-settings/data

1 file changed

+2
-1
lines changed

src/advanced-settings/data/api.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
} from '@edx/frontend-platform';
66
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
77
import { camelCase } from 'lodash';
8+
import { convertObjectToSnakeCase } from '../../utils';
89

910
const getApiBaseUrl = () => getConfig().STUDIO_BASE_URL;
1011
export const getCourseAdvancedSettingsApiUrl = (courseId) => `${getApiBaseUrl()}/api/contentstore/v0/advanced_settings/${courseId}`;
@@ -41,7 +42,7 @@ export async function getCourseAdvancedSettings(courseId) {
4142
*/
4243
export async function updateCourseAdvancedSettings(courseId, settings) {
4344
const { data } = await getAuthenticatedHttpClient()
44-
.patch(`${getCourseAdvancedSettingsApiUrl(courseId)}`, settings);
45+
.patch(`${getCourseAdvancedSettingsApiUrl(courseId)}`, convertObjectToSnakeCase(settings));
4546
const keepValues = {};
4647
Object.keys(data).forEach((key) => {
4748
keepValues[camelCase(key)] = { value: data[key].value };

0 commit comments

Comments
 (0)