Merge from git
This commit is contained in:
@@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user