@@ -64,6 +74,7 @@ let BuildSection = (props) => {
whichSection={props.whichSection}
sectionCount={props.sectionCount}
onSubmit={onSubmit}
+ props={props}
/>
{}
@@ -126,7 +137,9 @@ let BuildSection = (props) => {
{titleList[key].value}
) : (
-
{titleList[key].value}
+
+ {titleList[key].value}
+
)
)}
diff --git a/components/newappeal/complete.js b/components/newappeal/complete.js
index 58ff65eb..1d6791ad 100644
--- a/components/newappeal/complete.js
+++ b/components/newappeal/complete.js
@@ -60,7 +60,7 @@ let CompleteAppeal = (props) => {
Your reference number
- CAS-00010-J9W6L5
+ {props.appealType.caseReference}
diff --git a/components/newappeal/createCase.js b/components/newappeal/createCase.js
index 06c4436b..2c004a81 100644
--- a/components/newappeal/createCase.js
+++ b/components/newappeal/createCase.js
@@ -15,6 +15,8 @@ import {
getAppealTypeObj,
} from "../../store/appealType/action";
+import { createCase } from "../../actions";
+
let CreateCase = (props) => {
// useEffect(() => {
// window.scrollTo(0, 0);
@@ -100,9 +102,18 @@ let CreateCase = (props) => {
const onHandleSubmit = (values) => {
event.preventDefault();
- router.replace("/newappeal/" + values.appealTypes, null, {
- shallow: true,
- });
+
+ console.log(createCase("asasa", "asasa"));
+
+ const caseReference = createCase("123123", "213132");
+
+ router.replace(
+ "/newappeal/" + values.appealTypes + "?refno=" + caseReference,
+ null,
+ {
+ shallow: true,
+ }
+ );
console.log(values);
};
diff --git a/pages/newappeal/[appealtypes].js b/pages/newappeal/[appealtypes].js
index 27253c92..ecbc3737 100644
--- a/pages/newappeal/[appealtypes].js
+++ b/pages/newappeal/[appealtypes].js
@@ -19,6 +19,7 @@ import {
setAppealTypeTitle,
setAppealTypeID,
getAppealTypeObj,
+ setCaseReference,
} from "../../store/appealType/action";
import { setForm, getFormObj } from "../../store/formData/action";
import { getFormData, getAppealsTypes } from "../../actions";
@@ -31,10 +32,6 @@ import BuildCheckSection from "../../components/newappeal/buildchecksection";
import CompleteAppeal from "../../components/newappeal/complete";
let Home = (props) => {
- useEffect(() => {
- props.setFormTitle(formTitle);
- }, []);
-
const { footerLinks, pages, formData } = props;
let { t, lang } = useTranslation();
@@ -42,6 +39,10 @@ let Home = (props) => {
const { locale } = router;
const { appealtypes } = router.query;
+ useEffect(() => {
+ props.setFormTitle(formTitle);
+ props.setCaseReference(router.query.refno);
+ }, []);
const formXML = props.formData.formData;
const parser = new DOMParser();
var doc = parser.parseFromString(formXML, "text/xml");
@@ -171,6 +172,9 @@ const mapDispatchToProps = (dispatch) => {
setFormTitle: (title) => {
dispatch(setAppealTypeTitle(title));
},
+ setCaseReference: (refno) => {
+ dispatch(setCaseReference(refno));
+ },
};
};
diff --git a/store/appealType/action.js b/store/appealType/action.js
index 1e33ddb1..1d84825b 100644
--- a/store/appealType/action.js
+++ b/store/appealType/action.js
@@ -8,6 +8,7 @@ export const appealTypeDataActionTypes = {
UPDATEAPPEALTYPEDATA: "UPDATEAPPEALTYPEDATA",
SETCURRENTSECTION: "SETCURRENTSECTION",
SETAPPEALLPA: "SETAPPEALLPA",
+ SETCASEREFERENCE: "SETCASEREFERENCE",
};
export const getAppealTypeObj = () => (dispatch) => {
@@ -48,3 +49,10 @@ export const setAppealLPA = (appealLPA) => (dispatch) => {
appealLPA: appealLPA,
});
};
+
+export const setCaseReference = (caseReference) => (dispatch) => {
+ return dispatch({
+ type: appealTypeDataActionTypes.SETCASEREFERENCE,
+ caseReference: caseReference,
+ });
+};
diff --git a/store/appealType/reducer.js b/store/appealType/reducer.js
index 1f9ac3dd..2a20d35b 100644
--- a/store/appealType/reducer.js
+++ b/store/appealType/reducer.js
@@ -6,6 +6,7 @@ const appealTypeDataInitialState = {
appealTypeID: {},
currentSection: 1,
appealLPA: "",
+ caseReference: "",
};
export default function reducer(state = appealTypeDataInitialState, action) {
@@ -35,7 +36,11 @@ export default function reducer(state = appealTypeDataInitialState, action) {
...state,
appealLPA: action.appealLPA,
};
-
+ case appealTypeDataActionTypes.SETCASEREFERENCE:
+ return {
+ ...state,
+ caseReference: action.caseReference,
+ };
default:
return state;
}