Added tech routing paths and basic structure of landing page + sign in + reducers BOD-95
This commit is contained in:
19
client/src/redux/tech/tech.sagas.js
Normal file
19
client/src/redux/tech/tech.sagas.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { all, takeLatest, call, put } from "redux-saga/effects";
|
||||
import TechActionTypes from "./tech.types";
|
||||
import { client } from "../../App/App.container";
|
||||
import { loginSuccess, loginFailure } from "./tech.actions";
|
||||
|
||||
export function* onSignInStart() {
|
||||
yield takeLatest(TechActionTypes.LOGIN_START, signInStart);
|
||||
}
|
||||
export function* signInStart({ payload: { technician, password } }) {
|
||||
try {
|
||||
yield put(loginSuccess({ username: "TECHNICIAN" }));
|
||||
} catch (error) {
|
||||
yield put(loginFailure(error));
|
||||
}
|
||||
}
|
||||
|
||||
export function* techSagas() {
|
||||
yield all([call(onSignInStart)]);
|
||||
}
|
||||
Reference in New Issue
Block a user