Updated employee login

This commit is contained in:
jfrye122
2023-04-20 10:38:57 -04:00
parent bd0ba5c0df
commit 95a53222e7
6 changed files with 69 additions and 67 deletions

View File

@@ -1,8 +1,8 @@
import EmployeeActionTypes from "./employee.types";
import {
signInEmployeeStart,
signInEmployeeSuccess,
signInEmployeeFailure,
employeeSignInStart,
employeeSignInSuccess,
employeeSignInFailure,
} from "./employee.actions";
import { all, call, put, select, takeLatest } from "redux-saga/effects";
import { logImEXEvent } from "../../firebase/firebase.analytics";
@@ -11,7 +11,7 @@ import axios from "axios";
export function* onSignInEmployeeStart() {
yield takeLatest(
EmployeeActionTypes.SIGN_IN_EMPLOYEE_START,
EmployeeActionTypes.EMPLOYEE_SIGN_IN_START,
signInWithEmployeeId
);
}
@@ -29,12 +29,12 @@ export function* signInWithEmployeeId({ payload: { employeeId, pin } }) {
const { valid, technician, error } = response.data;
if (valid) {
yield put(signInEmployeeSuccess(technician));
yield put(employeeSignInSuccess(technician));
} else {
yield put(signInEmployeeFailure(error));
yield put(employeeSignInFailure(error));
}
} catch (error) {
yield put(signInEmployeeFailure(error));
yield put(employeeSignInFailure(error));
}
}