From 1fbfda007d65e378c5864c5b30c67d52ae142e0a Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Wed, 18 Jun 2025 18:11:01 +0500 Subject: [PATCH] fix: update advanced module list not working Backend was still expecting `{'advanced_modules', {'value': ['poll', 'problem-builder', 'h5pxblock']}}` but without this change, it was receiving `{'advancedModules', ['poll', 'problem-builder', 'h5pxblock']}` --- src/advanced-settings/data/api.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/advanced-settings/data/api.js b/src/advanced-settings/data/api.js index dae787a705..92a8a97272 100644 --- a/src/advanced-settings/data/api.js +++ b/src/advanced-settings/data/api.js @@ -5,6 +5,7 @@ import { } from '@edx/frontend-platform'; import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth'; import { camelCase } from 'lodash'; +import { convertObjectToSnakeCase } from '../../utils'; const getApiBaseUrl = () => getConfig().STUDIO_BASE_URL; export const getCourseAdvancedSettingsApiUrl = (courseId) => `${getApiBaseUrl()}/api/contentstore/v0/advanced_settings/${courseId}`; @@ -41,7 +42,7 @@ export async function getCourseAdvancedSettings(courseId) { */ export async function updateCourseAdvancedSettings(courseId, settings) { const { data } = await getAuthenticatedHttpClient() - .patch(`${getCourseAdvancedSettingsApiUrl(courseId)}`, settings); + .patch(`${getCourseAdvancedSettingsApiUrl(courseId)}`, convertObjectToSnakeCase(settings)); const keepValues = {}; Object.keys(data).forEach((key) => { keepValues[camelCase(key)] = { value: data[key].value };