added pShift scaffolding

This commit is contained in:
Alexander Wong
2018-04-22 23:04:09 -06:00
parent 2b15495072
commit 0fc6ac31f5
13 changed files with 379 additions and 2 deletions
+52
View File
@@ -0,0 +1,52 @@
import {
IS_SENDING_PSHIFT_REQUEST,
SET_PSHIFT_REQUEST_ERROR,
SET_PSHIFT_REQUEST_SUCCESS,
CLEAR_PSHIFT_REQUEST_ERROR,
CLEAR_PSHIFT_REQUEST_SUCCESS,
SET_CLEAR_PSHIFT_STATE
} from "../constants/pShift.constants";
const initialState = {
isSendingPShiftRequest: false,
pShiftRequestError: "",
pShiftRequestSuccess: ""
};
function pShiftReducer(state = initialState, action) {
switch (action.type) {
case IS_SENDING_PSHIFT_REQUEST:
return {
...state,
isSendingPShiftRequest: action.data
};
case SET_PSHIFT_REQUEST_ERROR:
return {
...state,
pShiftRequestError: action.data
};
case CLEAR_PSHIFT_REQUEST_ERROR:
return {
...state,
pShiftRequestError: ""
};
case SET_PSHIFT_REQUEST_SUCCESS:
return {
...state,
pShiftRequestSuccess: action.data
};
case CLEAR_PSHIFT_REQUEST_SUCCESS:
return {
...state,
pShiftRequestSuccess: ""
};
case SET_CLEAR_PSHIFT_STATE:
return {
...initialState
};
default:
return { ...state };
}
}
export default pShiftReducer;