Tech login and checklist fixes.

This commit is contained in:
Patrick Fic
2021-02-24 10:38:55 -08:00
parent 57600a1e5a
commit 19207013e2
8 changed files with 56 additions and 60 deletions

View File

@@ -16,6 +16,7 @@ const applicationReducer = (state = INITIAL_STATE, action) => {
return {
...state,
technician: null,
loginError: null,
};
case TechActionTypes.TECH_LOGIN_START:
return {

View File

@@ -1,6 +1,6 @@
import axios from "axios";
import { all, call, put, select, takeLatest } from "redux-saga/effects";
import { auth, logImEXEvent } from "../../firebase/firebase.utils";
import { logImEXEvent } from "../../firebase/firebase.utils";
import { selectBodyshop } from "../user/user.selectors";
import { techLoginFailure, techLoginSuccess } from "./tech.actions";
import TechActionTypes from "./tech.types";
@@ -13,20 +13,11 @@ export function* signInStart({ payload: { employeeid, pin } }) {
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,
},
{
headers: {
Authorization: `Bearer ${yield auth.currentUser.getIdToken()}`,
},
}
);
const response = yield call(axios.post, "/tech/login", {
shopid: bodyshop.id,
employeeid: employeeid,
pin: pin,
});
const { valid, technician, error } = response.data;