my cases portal module by loggedin user

This commit is contained in:
robert.bond@test.gov.wales
2021-09-17 16:37:06 +01:00
parent 219e6a4744
commit c96a72f124
26 changed files with 673 additions and 107 deletions
+9
View File
@@ -1,6 +1,7 @@
export const myRepresentationsActionTypes = {
GETMYREPRESENTATIONS: "GETMYREPRESENTATIONS",
SETMYREPRESENTATIONS: "SETMYREPRESENTATIONS",
SETMYREPRESENTATIONSDETAILS: "SETMYREPRESENTATIONSDETAILS",
UPDATEMYREPRESENTATIONS: "UPDATEMYREPRESENTATIONS",
};
@@ -16,3 +17,11 @@ export const setMyRepresentations = (myRepresentations) => (dispatch) => {
myRepresentations: myRepresentations,
});
};
export const setMyRepresentationsDetails =
(myRepresentationsDetails) => (dispatch) => {
return dispatch({
type: myRepresentationsActionTypes.SETMYREPRESENTATIONSDETAILS,
myRepresentationsDetails: myRepresentationsDetails,
});
};
+7
View File
@@ -2,14 +2,21 @@ import { myRepresentationsActionTypes } from "./action";
const myRepresentationsInitialState = {
myRepresentations: {},
myRepresentationsDetails: {},
};
export default function reducer(state = myRepresentationsInitialState, action) {
switch (action.type) {
case myRepresentationsActionTypes.SETMYREPRESENTATIONS:
return {
...state,
myRepresentations: action.myRepresentations,
};
case myRepresentationsActionTypes.SETMYREPRESENTATIONSDETAILS:
return {
...state,
myRepresentationsDetails: action.myRepresentationsDetails,
};
default:
return state;
}