added mock call for case view

This commit is contained in:
2021-08-02 16:29:13 +01:00
parent 9bbd0aa741
commit 7ce4460b47
24 changed files with 1135 additions and 267 deletions
+8
View File
@@ -1,6 +1,7 @@
export const currentViewActionTypes = {
GETCURRENTVIEW: "GETCURRENTVIEW",
SETCURRENTVIEW: "SETCURRENTVIEW",
SETCURRENTREFERENCE: "SETCURRENTREFERENCE",
};
export const getCurrentViewObj = () => (dispatch) => {
@@ -15,3 +16,10 @@ export const setCurrentView = (currentView) => (dispatch) => {
currentView: currentView,
});
};
export const setCurrentReference = (caseReference) => (dispatch) => {
return dispatch({
type: currentViewActionTypes.SETCURRENTREFERENCE,
caseReference: caseReference,
});
};
+6
View File
@@ -2,6 +2,7 @@ import { currentViewActionTypes } from "./action";
const currentViewInitialState = {
currentView: {},
caseReference: {},
};
export default function reducer(state = currentViewInitialState, action) {
@@ -11,6 +12,11 @@ export default function reducer(state = currentViewInitialState, action) {
...state,
currentView: action.currentView,
};
case currentViewActionTypes.SETCURRENTREFERENCE:
return {
...state,
caseReference: action.caseReference,
};
default:
return state;
}