Updated employee login
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user