refactor(newappeal): extract payload cleanup helpers (Slice 2a)

- extracted boolean normalization

- extracted null key removal

- extracted internal key stripping

- no behaviour change
This commit is contained in:
2026-04-10 16:37:42 +01:00
parent 5f78a881c5
commit 5233f62d59
4 changed files with 42 additions and 21 deletions
+2 -4
View File
@@ -5,6 +5,7 @@ import { useEffect } from "react";
import { connect } from "react-redux";
import { formValueSelector } from "redux-form";
import { sendEmail } from "../../actions/services/notifyService";
import { normalizeYesNoBooleans } from "../../lib/newappeal/payloadCleanup";
import { setCurrentSection } from "../../store/appealType/action";
import { getFormCollectionByID } from "../utils";
@@ -31,10 +32,7 @@ let CompleteAppeal = (props) => {
"/incidents(" + incidentId + ")"
});
updateBody = JSON.stringify(updateBody);
updateBody = updateBody.replace(/:"Yes"/gm, `:true`);
updateBody = updateBody.replace(/:"No"/gm, `:false`);
updateBody = JSON.parse(updateBody);
updateBody = normalizeYesNoBooleans(updateBody);
let updateFormCollection = appTypeCollection.LogicalCollectionName;
let primaryAttribute = appTypeCollection.PrimaryIdAttribute;