Add logger and resolve log in issue.
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
signInEmployeeSuccess,
|
||||
signInEmployeeFailure,
|
||||
} from "./employee.actions";
|
||||
import { all, call, put, takeLatest } from "redux-saga/effects";
|
||||
import { all, call, put, select, takeLatest } from "redux-saga/effects";
|
||||
import { logImEXEvent } from "../../firebase/firebase.analytics";
|
||||
import { selectBodyshop } from "../user/user.selectors";
|
||||
import axios from "axios";
|
||||
@@ -15,14 +15,15 @@ export function* onSignInEmployeeStart() {
|
||||
signInWithEmployeeId
|
||||
);
|
||||
}
|
||||
export function* signInWithEmployeeId({ payload: { employeeid, pin } }) {
|
||||
export function* signInWithEmployeeId({ payload: { employeeId, pin } }) {
|
||||
try {
|
||||
logImEXEvent("redux_sign_in_employee_attempt");
|
||||
//console.loging
|
||||
console.log("Saga", employeeId, pin, pin);
|
||||
const bodyshop = yield select(selectBodyshop);
|
||||
const response = yield call(axios.post, "/tech/login", {
|
||||
shopid: bodyshop.id,
|
||||
employeeid: employeeid,
|
||||
employeeid: employeeId,
|
||||
pin: pin,
|
||||
});
|
||||
const { valid, technician, error } = response.data;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { applyMiddleware, compose, createStore } from "redux";
|
||||
import { persistStore } from "redux-persist";
|
||||
//import { createLogger } from "redux-logger";
|
||||
import { createLogger } from "redux-logger";
|
||||
import createSagaMiddleware from "redux-saga";
|
||||
import rootReducer from "./root.reducer";
|
||||
import rootSaga from "./root.saga";
|
||||
@@ -9,11 +9,11 @@ const sagaMiddleWare = createSagaMiddleware();
|
||||
|
||||
const middlewares = [sagaMiddleWare];
|
||||
// if (process.env.NODE_ENV === "development") {
|
||||
// middlewares.push(
|
||||
// createLogger({
|
||||
// collapsed: true,
|
||||
// })
|
||||
// );
|
||||
middlewares.push(
|
||||
createLogger({
|
||||
collapsed: true,
|
||||
})
|
||||
);
|
||||
// }
|
||||
|
||||
//Add in for React Native Debugger.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import axios from "axios";
|
||||
import { auth } from "../firebase/firebase.utils";
|
||||
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
axios.defaults.baseURL =
|
||||
process.env.REACT_APP_AXIOS_BASE_API_URL || "https://api.imex.online/";
|
||||
}
|
||||
import env from "../env";
|
||||
//if (process.env.NODE_ENV === "production") {
|
||||
axios.defaults.baseURL = "https://api.test.imex.online/";
|
||||
//env.REACT_APP_AXIOS_BASE_API_URL || "https://api.imex.online/";
|
||||
//}
|
||||
|
||||
export const axiosAuthInterceptorId = axios.interceptors.request.use(
|
||||
async (config) => {
|
||||
|
||||
Reference in New Issue
Block a user