added mock call for case view
This commit is contained in:
@@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user