add methods and store for case reference

This commit is contained in:
2021-07-20 11:26:25 +01:00
parent 0d9015d772
commit 4c31728322
10 changed files with 69 additions and 16 deletions
+15 -2
View File
@@ -6,7 +6,11 @@ import xpath from "xpath";
import BuildRow from "./buildrow";
import { reduxForm, formValueSelector } from "redux-form";
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
import { setCurrentSection } from "../../store/appealType/action";
import {
setCaseReference,
setCurrentSection,
} from "../../store/appealType/action";
import { query } from "jsonpath";
let BuildSection = (props) => {
// useEffect(() => {
@@ -25,6 +29,7 @@ let BuildSection = (props) => {
handleSubmit,
formTitle,
setCurrentSection,
refno,
} = props;
const currentSection = props.appealType.currentSection;
@@ -50,8 +55,13 @@ let BuildSection = (props) => {
const onHandleSubmit = (values) => {
setCurrentSection(currentSection + 1);
setCaseReference(router.query.refno);
};
// const initialValues = {
// email: router.query.refno,
// };
return (
<div className="govuk-grid-row">
<div className="govuk-grid-column-two-thirds">
@@ -64,6 +74,7 @@ let BuildSection = (props) => {
whichSection={props.whichSection}
sectionCount={props.sectionCount}
onSubmit={onSubmit}
props={props}
/>
{}
<div className="govuk-button-group">
@@ -126,7 +137,9 @@ let BuildSection = (props) => {
<b>{titleList[key].value}</b>
</li>
) : (
<li>{titleList[key].value}</li>
<li key={key}>
{titleList[key].value}
</li>
)
)}
</ol>