Merged PR 2241: refactor(newappeal): simplify start flow readability (Slice 8)

refactor(newappeal): simplify start flow readability (Slice 8)

Related work items: #22590
This commit is contained in:
Robert Bond
2026-04-13 12:55:58 +00:00
parent ffcccf8981
commit f3a05db323
3 changed files with 32 additions and 25 deletions
+12 -8
View File
@@ -378,6 +378,7 @@ let CreateCase = (props) => {
const router = useRouter();
const { locale } = router;
const isWelsh = router.locale == "cy";
const { LPAData, onSubmit, handleSubmit, formData } = props;
@@ -399,16 +400,17 @@ let CreateCase = (props) => {
event.preventDefault();
var appTypeCollection = values.appealTypes;
const selectedAppealType = values.appealTypes;
const confirmHASCAS = values.confirmHASCAS;
formStep == 0 && setFormStep(1);
whichAppealType =
values.appealTypes == "846040004" && values.confirmHASCAS == "true"
selectedAppealType == "846040004" && confirmHASCAS == "true"
? "846040004"
: values.appealTypes == "846040004" &&
values.confirmHASCAS == "false"
: selectedAppealType == "846040004" && confirmHASCAS == "false"
? "846040000"
: values.appealTypes;
: selectedAppealType;
var whichAppealType = whichAppealType;
@@ -435,15 +437,17 @@ let CreateCase = (props) => {
// values,
// props.containerID
// )
const selectedLpaName = props.LPAData.LPAData.value.filter((obj) => {
return obj.accountid === values.lpaTypes;
})[0].name;
createNewCaseBlob(
appTypeCollection.appealTypeID,
values.lpaTypes,
props.loggedInUser,
values,
props.containerID,
props.LPAData.LPAData.value.filter((obj) => {
return obj.accountid === values.lpaTypes;
})[0].name
selectedLpaName
)
.then((data) => {
router.replace(
@@ -477,7 +481,7 @@ let CreateCase = (props) => {
// }
// );
};
const yesNo = router.locale == "cy" ? ["Ydw", "Na"] : ["Yes", "No"];
const yesNo = isWelsh ? ["Ydw", "Na"] : ["Yes", "No"];
var parentField = "appealTypes",
formProps = props.whichForm,