From b510b6f69f6d2e1d6ca9721ff2cdb53785369fe3 Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Thu, 19 Jun 2025 01:33:03 +0500 Subject: [PATCH] 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 https://github.com/openedx/frontend-app-authoring/pull/1581 Co-authored-by: Muhammad Faraz Maqsood --- 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 dae787a70..92a8a9727 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 };