Skip to content

Commit f9ce381

Browse files
fix(content): change numeric input validation path to new url and loader added
1 parent 9b57066 commit f9ce381

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

  • src/editors

src/editors/containers/ProblemEditor/components/EditProblemView/AnswerWidget/AnswerOption.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Icon,
77
IconButton,
88
Form,
9+
Spinner,
910
} from '@openedx/paragon';
1011
import { FeedbackOutline, DeleteOutline } from '@openedx/paragon/icons';
1112
import { FormattedMessage, useIntl } from '@edx/frontend-platform/i18n';
@@ -44,7 +45,7 @@ const AnswerOption = ({
4445
const setSelectedFeedback = hooks.setSelectedFeedback({ answer, hasSingleAnswer, dispatch });
4546
const setUnselectedFeedback = hooks.setUnselectedFeedback({ answer, hasSingleAnswer, dispatch });
4647
const { isFeedbackVisible, toggleFeedback } = hooks.useFeedback(answer);
47-
const { data = { is_valid: true }, mutate } = useValidateInputBlock();
48+
const { data = { is_valid: true }, mutate, isPending } = useValidateInputBlock();
4849

4950
const staticRootUrl = isLibrary
5051
? `${getConfig().STUDIO_BASE_URL}/library_assets/blocks/${blockId}/`
@@ -91,6 +92,9 @@ const AnswerOption = ({
9192
<FormattedMessage {...messages.answerNumericErrorText} />
9293
</Form.Control.Feedback>
9394
)}
95+
{isPending && (
96+
<Spinner animation="border" className="mie-3 mt-3" screenReaderText="loading" />
97+
)}
9498
</Form.Group>
9599
);
96100
}

src/editors/data/services/cms/urls.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,5 @@ export const handlerUrl = (({ studioEndpointUrl, blockId, handlerName }) => (
125125
)) satisfies UrlFunction;
126126

127127
export const validateNumericInputUrl = (({ studioEndpointUrl }) => (
128-
`${studioEndpointUrl}/api/courses/v1/validate/numerical-input/`
128+
`${studioEndpointUrl}/api/contentstore/v2/validate/numerical-input/`
129129
)) satisfies UrlFunction;

0 commit comments

Comments
 (0)