add mock api calls for modules viewall component
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
export const myRepresentationsActionTypes = {
|
||||
GETMYREPRESENTATIONS: "GETMYREPRESENTATIONS",
|
||||
SETMYREPRESENTATIONS: "SETMYREPRESENTATIONS",
|
||||
UPDATEMYREPRESENTATIONS: "UPDATEMYREPRESENTATIONS",
|
||||
};
|
||||
|
||||
export const getMyRepresentationsObj = () => (dispatch) => {
|
||||
return dispatch({
|
||||
type: myRepresentationsActionTypes.GETMYREPRESENTATIONS,
|
||||
});
|
||||
};
|
||||
|
||||
export const setMyRepresentations = (myRepresentations) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: myRepresentationsActionTypes.SETMYREPRESENTATIONS,
|
||||
myRepresentations: myRepresentations,
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
import { myRepresentationsActionTypes } from "./action";
|
||||
|
||||
const myRepresentationsInitialState = {
|
||||
myRepresentations: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = myRepresentationsInitialState, action) {
|
||||
switch (action.type) {
|
||||
case myRepresentationsActionTypes.SETMYREPRESENTATIONS:
|
||||
return {
|
||||
myRepresentations: action.myRepresentations,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user