add mock api calls for modules viewall component
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
export const currentViewActionTypes = {
|
||||
GETCURRENTVIEW: "GETCURRENTVIEW",
|
||||
SETCURRENTVIEW: "SETCURRENTVIEW",
|
||||
};
|
||||
|
||||
export const getCurrentViewObj = () => (dispatch) => {
|
||||
return dispatch({
|
||||
type: currentViewActionTypes.GETCURRENTVIEW,
|
||||
});
|
||||
};
|
||||
|
||||
export const setCurrentView = (currentView) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: currentViewActionTypes.SETCURRENTVIEW,
|
||||
currentView: currentView,
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
import { currentViewActionTypes } from "./action";
|
||||
|
||||
const currentViewInitialState = {
|
||||
currentView: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = currentViewInitialState, action) {
|
||||
switch (action.type) {
|
||||
case currentViewActionTypes.SETCURRENTVIEW:
|
||||
return {
|
||||
...state,
|
||||
currentView: action.currentView,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user