Skip to content

Commit

Permalink
👽 [open-formulieren/open-forms#3283] The backend now uses consistent …
Browse files Browse the repository at this point in the history
…casing in the API endpoints

Switched from underscore to kebab case, so hardcoded endpoints need to
be adapted.
  • Loading branch information
sergei-maertens committed Dec 12, 2024
1 parent 0a335fa commit b844b99
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/api-mocks/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {HttpResponse, http} from 'msw';
import {BASE_URL} from './base';

export const mockAnalyticsToolConfigGet = (overrides = {}) =>
http.get(`${BASE_URL}analytics/analytics_tools_config_info`, () =>
http.get(`${BASE_URL}analytics/analytics-tools-config-info`, () =>
HttpResponse.json({
govmetricSourceId: '',
govmetricSecureGuid: '',
Expand Down
2 changes: 1 addition & 1 deletion src/api-mocks/submissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const mockSubmissionStepGet = () =>
});

export const mockSubmissionCheckLogicPost = () =>
http.post(`${BASE_URL}submissions/:uuid/steps/:uuid/_check_logic`, () => {
http.post(`${BASE_URL}submissions/:uuid/steps/:uuid/_check-logic`, () => {
const responseData = {
submission: SUBMISSION_DETAILS,
step: SUBMISSION_STEP_DETAILS,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const Form = () => {
const [, expiryDate, resetSession] = useSessionTimeout();

const {value: analyticsToolsConfigInfo, loading: loadingAnalyticsConfig} = useAsync(async () => {
return await get(`${config.baseUrl}analytics/analytics_tools_config_info`);
return await get(`${config.baseUrl}analytics/analytics-tools-config-info`);
}, [intl.locale]);

useEffect(
Expand Down
6 changes: 3 additions & 3 deletions src/components/FormStep/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const getCustomValidationHook = (stepUrl, onBackendError) => {
};

/**
* Submits the form step data to the backend in order te evaluate its logic using the _check_Logic
* Submits the form step data to the backend in order te evaluate its logic using the _check-logic
* endpoint.
* @param {string} stepUrl
* @param {Object} data The current form data.
Expand All @@ -146,7 +146,7 @@ const getCustomValidationHook = (stepUrl, onBackendError) => {
* @return {Promise}
*/
const doLogicCheck = async (stepUrl, data, invalidKeys = [], signal) => {
const url = `${stepUrl}/_check_logic`;
const url = `${stepUrl}/_check-logic`;
// filter out the invalid keys so we only send valid (client-side) input data to the
// backend to evaluate logic.
let dataForLogicCheck = invalidKeys.length ? omit(data, invalidKeys) : data;
Expand Down Expand Up @@ -407,7 +407,7 @@ const FormStep = ({form, submission, onLogicChecked, onStepSubmitted, onDestroyS
};

/**
* Check whether a current logic using the _check_Logic endpoint should be cancelled.
* Check whether a current logic using the _check-logic endpoint should be cancelled.
* @throws {AbortedLogicCheck} Throws an AbortedLogicCheck if the current logic check should be
* aborted
* @param {*} signal
Expand Down
2 changes: 1 addition & 1 deletion src/components/FormStep/mocks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const mockSubmissionStepGet = body =>
http.get(`${BASE_URL}submissions/:submissionUuid/steps/:stepUuid`, () => HttpResponse.json(body));

export const mockSubmissionLogicCheckPost = (submission, step) => {
return http.post(`${BASE_URL}submissions/:submissionUuid/steps/:stepUuid/_check_logic`, () =>
return http.post(`${BASE_URL}submissions/:submissionUuid/steps/:stepUuid/_check-logic`, () =>
HttpResponse.json({submission, step})
);
};
Expand Down

0 comments on commit b844b99

Please sign in to comment.