added actions,types and reducer cases

This commit is contained in:
jfrye122
2023-05-05 09:26:34 -04:00
parent 53b1a02f47
commit a5f2af6fda
3 changed files with 41 additions and 6 deletions

View File

@@ -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;