adding reducer and saga for employee

This commit is contained in:
jfrye122
2023-04-13 13:34:20 -04:00
parent 35573417c4
commit f8a0992efe
4 changed files with 26 additions and 6 deletions

View File

@@ -27,3 +27,9 @@ export function loginEmployeeSuccess(technician) {
payload: technician
}
}
export function loginEmployeeFal(error) {
return {
type: EmployeeActionTypes.AUTHORIZING_EMPLOYEE_FALURE,
error: error
}
}

View File

@@ -4,6 +4,7 @@ import { persistReducer } from "redux-persist";
import appReducer from "./app/app.reducer";
import photosReducer from "./photos/photos.reducer";
import userReducer from "./user/user.reducer";
import employeeReducer from './employee/employee.reducer';
const persistConfig = {
key: "root",
@@ -12,10 +13,12 @@ const persistConfig = {
blacklist: ["user"],
};
//ADDED JF employee: employeeReducer
const rootReducer = combineReducers({
user: userReducer,
app: appReducer,
photos: photosReducer,
employee: employeeReducer,
});
export default persistReducer(persistConfig, rootReducer);

View File

@@ -2,7 +2,8 @@ import { all, call } from "redux-saga/effects";
import { appSagas } from "./app/app.sagas";
import { photosSagas } from "./photos/photos.sagas";
import { userSagas } from "./user/user.sagas";
import { employeeSagas } from "./employee/employee.sagas";
export default function* rootSaga() {
yield all([call(userSagas), call(appSagas), call(photosSagas)]);
yield all([call(userSagas), call(appSagas), call(photosSagas), call(employeeSagas)]);
}