add mock api calls for modules viewall component
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
export const watchedCasesActionTypes = {
|
||||
GETWATCHEDCASES: "GETWATCHEDCASES",
|
||||
SETWATCHEDCASES: "SETWATCHEDCASES",
|
||||
UPDATEWATCHEDCASES: "UPDATEWATCHEDCASES",
|
||||
};
|
||||
|
||||
export const getWatchedCasesObj = () => (dispatch) => {
|
||||
return dispatch({
|
||||
type: watchedCasesActionTypes.GETWATCHEDCASES,
|
||||
});
|
||||
};
|
||||
|
||||
export const setWatchedCases = (watchedCases) => (dispatch) => {
|
||||
return dispatch({
|
||||
type: watchedCasesActionTypes.SETWATCHEDCASES,
|
||||
watchedCases: watchedCases,
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
import { watchedCasesActionTypes } from "./action";
|
||||
|
||||
const watchedCasesInitialState = {
|
||||
watchedCases: {},
|
||||
};
|
||||
|
||||
export default function reducer(state = watchedCasesInitialState, action) {
|
||||
switch (action.type) {
|
||||
case watchedCasesActionTypes.SETWATCHEDCASES:
|
||||
return {
|
||||
watchedCases: action.watchedCases,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user