Resolve tech login issue.
This commit is contained in:
@@ -323,7 +323,7 @@ export function JobLinesComponent({
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
disabled={
|
disabled={
|
||||||
!job.converted ||
|
(job && !job.converted) ||
|
||||||
(selectedLines.length > 0 ? false : true) ||
|
(selectedLines.length > 0 ? false : true) ||
|
||||||
jobRO
|
jobRO
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { all, call, put, select, takeLatest } from "redux-saga/effects";
|
import { all, call, put, select, takeLatest } from "redux-saga/effects";
|
||||||
|
import { auth, logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import { selectBodyshop } from "../user/user.selectors";
|
import { selectBodyshop } from "../user/user.selectors";
|
||||||
import { techLoginFailure, techLoginSuccess } from "./tech.actions";
|
import { techLoginFailure, techLoginSuccess } from "./tech.actions";
|
||||||
import TechActionTypes from "./tech.types";
|
import TechActionTypes from "./tech.types";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
|
||||||
|
|
||||||
export function* onSignInStart() {
|
export function* onSignInStart() {
|
||||||
yield takeLatest(TechActionTypes.TECH_LOGIN_START, signInStart);
|
yield takeLatest(TechActionTypes.TECH_LOGIN_START, signInStart);
|
||||||
@@ -13,11 +13,20 @@ export function* signInStart({ payload: { employeeid, pin } }) {
|
|||||||
logImEXEvent("redux_tech_sign_in");
|
logImEXEvent("redux_tech_sign_in");
|
||||||
|
|
||||||
const bodyshop = yield select(selectBodyshop);
|
const bodyshop = yield select(selectBodyshop);
|
||||||
const response = yield call(axios.post, "/tech/login", {
|
const response = yield call(
|
||||||
shopid: bodyshop.id,
|
axios.post,
|
||||||
employeeid: employeeid,
|
"/tech/login",
|
||||||
pin: pin,
|
{
|
||||||
});
|
shopid: bodyshop.id,
|
||||||
|
employeeid: employeeid,
|
||||||
|
pin: pin,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${yield auth.currentUser.getIdToken()}`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const { valid, technician, error } = response.data;
|
const { valid, technician, error } = response.data;
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const axiosAuthInterceptorId = axios.interceptors.request.use(
|
|||||||
config.headers.Authorization = `Bearer ${token}`;
|
config.headers.Authorization = `Bearer ${token}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log("Axios interceptor called.");
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
(error) => Promise.reject(error)
|
(error) => Promise.reject(error)
|
||||||
|
|||||||
Reference in New Issue
Block a user