Added first round of analytics and event tracking BOD-190
This commit is contained in:
@@ -3,30 +3,25 @@ import { all, call, put, select, takeLatest } from "redux-saga/effects";
|
||||
import { selectBodyshop } from "../user/user.selectors";
|
||||
import { techLoginFailure, techLoginSuccess } from "./tech.actions";
|
||||
import TechActionTypes from "./tech.types";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
|
||||
export function* onSignInStart() {
|
||||
yield takeLatest(TechActionTypes.TECH_LOGIN_START, signInStart);
|
||||
}
|
||||
export function* signInStart({ payload: { employeeid, pin } }) {
|
||||
try {
|
||||
logImEXEvent("redux_tech_sign_in");
|
||||
|
||||
const bodyshop = yield select(selectBodyshop);
|
||||
const response = yield call(axios.post, "/tech/login", {
|
||||
shopid: bodyshop.id,
|
||||
employeeid: employeeid,
|
||||
pin: pin,
|
||||
});
|
||||
console.log("response", response);
|
||||
|
||||
const { valid, technician, error } = response.data;
|
||||
|
||||
console.log(
|
||||
"function*signInStart -> valid, technician, erro",
|
||||
valid,
|
||||
technician,
|
||||
error
|
||||
);
|
||||
|
||||
if (valid) {
|
||||
console.log("Valid in else");
|
||||
yield put(techLoginSuccess(technician));
|
||||
} else {
|
||||
yield put(techLoginFailure(error));
|
||||
|
||||
Reference in New Issue
Block a user