added actions,types and reducer cases
This commit is contained in:
@@ -4,6 +4,7 @@ const INITIAL_STATE = {
|
||||
currentEmployee: {
|
||||
authorized: null,
|
||||
technician: null,
|
||||
rates:[],
|
||||
},
|
||||
signingIn: false,
|
||||
error: null,
|
||||
@@ -23,17 +24,23 @@ const employeeReducer = (state = INITIAL_STATE, action) => {
|
||||
signingIn: false,
|
||||
error: null,
|
||||
};
|
||||
case EmployeeActionTypes.EMPLOYEE_SIGN_IN_FAILURE:
|
||||
return {
|
||||
...state,
|
||||
signingIn: false,
|
||||
error: action.payload,
|
||||
};
|
||||
case EmployeeActionTypes.EMPLOYEE_SIGN_OUT:
|
||||
return {
|
||||
...state,
|
||||
currentEmployee: { authorized: false, technician:null },
|
||||
error: null,
|
||||
};
|
||||
case EmployeeActionTypes.EMPLOYEE_SIGN_IN_FAILURE:
|
||||
|
||||
case EmployeeActionTypes.SET_CAMERA_JOB:
|
||||
return {
|
||||
...state,
|
||||
signingIn: false,
|
||||
error: action.payload,
|
||||
currentEmployee: { rates:action.payload },
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
|
||||
Reference in New Issue
Block a user