added functional duration/time selector

This commit is contained in:
Alexander Wong
2018-04-18 16:50:02 -06:00
parent 99dc3a9615
commit 0c8defd469
7 changed files with 190 additions and 25 deletions
+15 -1
View File
@@ -6,6 +6,8 @@ import {
CLEAR_CSHIFT_REQUEST_SUCCESS,
SET_FORM_EMPLOYEE_UUID,
SET_FORM_PRICE_UUID,
SET_FORM_SHIFT_START_TIME,
SET_FORM_SHIFT_DURATION,
SET_CLEAR_CSHIFT_STATE
} from "../constants/cShift.constants";
@@ -14,7 +16,9 @@ const initialState = {
cShiftRequestError: "",
cShiftRequestSuccess: "",
employeeUUID: "",
priceUUID: ""
priceUUID: "",
startTime: null,
duration: 60
};
function cShiftReducer(state = initialState, action) {
@@ -54,6 +58,16 @@ function cShiftReducer(state = initialState, action) {
...state,
priceUUID: action.data
};
case SET_FORM_SHIFT_START_TIME:
return {
...state,
startTime: action.data
};
case SET_FORM_SHIFT_DURATION:
return {
...state,
duration: action.data
};
case SET_CLEAR_CSHIFT_STATE:
return {
...initialState