create incident record in new appeal

This commit is contained in:
robert.bond@test.gov.wales
2021-09-09 12:29:18 +01:00
parent 2825ab5a7d
commit b12b5ef64b
9 changed files with 161 additions and 116 deletions
+23 -9
View File
@@ -43,7 +43,9 @@ let CreateCase = (props) => {
? [{}]
: _.isEmpty(props.LPAData.LPAData)
? [{}]
: jsonpath.query(props.LPAData.LPAData, "$..name");
: _.isEmpty(props.LPAData.LPAData)
? [{}]
: props.LPAData.LPAData.value;
const RenderLPAList = ({
name,
@@ -94,9 +96,9 @@ let CreateCase = (props) => {
return (
<option
key={key}
value={optionsObj[key]}
value={optionsObj[key].accountid}
>
{optionsObj[key]}
{optionsObj[key].name}
</option>
);
})}
@@ -167,7 +169,10 @@ let CreateCase = (props) => {
.value
)
? ""
: optionsObj[key].value
: optionsObj[key]
.attributevalue +
"," +
optionsObj[key].value
.replace(
/[\s\-\+\(\)\,]/g,
""
@@ -198,9 +203,18 @@ let CreateCase = (props) => {
const onHandleSubmit = (values) => {
event.preventDefault();
router.replace("/newappeal/" + values.appealTypes, null, {
shallow: true,
});
router.replace(
"/newappeal/" +
values.appealTypes.split(",")[1] +
"?lpa=" +
values.lpaTypes +
"&apt=" +
values.appealTypes.split(",")[0],
null,
{
shallow: true,
}
);
};
return (
@@ -254,8 +268,8 @@ const mapDispatchToProps = (dispatch) => {
);
dispatch(setAppealTypeID(event.target.value));
},
onChangeSelectLPA: (event) => {
dispatch(setAppealLPA(event.target.value));
onChangeSelectLPA: (lpaId) => {
dispatch(setAppealLPA(lpaId));
},
};
};