Add logger and resolve log in issue.

This commit is contained in:
Patrick Fic
2023-04-13 10:52:22 -07:00
parent f8a0992efe
commit 20406c1071
3 changed files with 15 additions and 14 deletions

View File

@@ -4,7 +4,7 @@ import {
signInEmployeeSuccess, signInEmployeeSuccess,
signInEmployeeFailure, signInEmployeeFailure,
} from "./employee.actions"; } 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 { logImEXEvent } from "../../firebase/firebase.analytics";
import { selectBodyshop } from "../user/user.selectors"; import { selectBodyshop } from "../user/user.selectors";
import axios from "axios"; import axios from "axios";
@@ -15,14 +15,15 @@ export function* onSignInEmployeeStart() {
signInWithEmployeeId signInWithEmployeeId
); );
} }
export function* signInWithEmployeeId({ payload: { employeeid, pin } }) { export function* signInWithEmployeeId({ payload: { employeeId, pin } }) {
try { try {
logImEXEvent("redux_sign_in_employee_attempt"); logImEXEvent("redux_sign_in_employee_attempt");
//console.loging //console.loging
console.log("Saga", employeeId, pin, pin);
const bodyshop = yield select(selectBodyshop); const bodyshop = yield select(selectBodyshop);
const response = yield call(axios.post, "/tech/login", { const response = yield call(axios.post, "/tech/login", {
shopid: bodyshop.id, shopid: bodyshop.id,
employeeid: employeeid, employeeid: employeeId,
pin: pin, pin: pin,
}); });
const { valid, technician, error } = response.data; const { valid, technician, error } = response.data;

View File

@@ -1,6 +1,6 @@
import { applyMiddleware, compose, createStore } from "redux"; import { applyMiddleware, compose, createStore } from "redux";
import { persistStore } from "redux-persist"; import { persistStore } from "redux-persist";
//import { createLogger } from "redux-logger"; import { createLogger } from "redux-logger";
import createSagaMiddleware from "redux-saga"; import createSagaMiddleware from "redux-saga";
import rootReducer from "./root.reducer"; import rootReducer from "./root.reducer";
import rootSaga from "./root.saga"; import rootSaga from "./root.saga";
@@ -9,11 +9,11 @@ const sagaMiddleWare = createSagaMiddleware();
const middlewares = [sagaMiddleWare]; const middlewares = [sagaMiddleWare];
// if (process.env.NODE_ENV === "development") { // if (process.env.NODE_ENV === "development") {
// middlewares.push( middlewares.push(
// createLogger({ createLogger({
// collapsed: true, collapsed: true,
// }) })
// ); );
// } // }
//Add in for React Native Debugger. //Add in for React Native Debugger.

View File

@@ -1,10 +1,10 @@
import axios from "axios"; import axios from "axios";
import { auth } from "../firebase/firebase.utils"; import { auth } from "../firebase/firebase.utils";
import env from "../env";
if (process.env.NODE_ENV === "production") { //if (process.env.NODE_ENV === "production") {
axios.defaults.baseURL = axios.defaults.baseURL = "https://api.test.imex.online/";
process.env.REACT_APP_AXIOS_BASE_API_URL || "https://api.imex.online/"; //env.REACT_APP_AXIOS_BASE_API_URL || "https://api.imex.online/";
} //}
export const axiosAuthInterceptorId = axios.interceptors.request.use( export const axiosAuthInterceptorId = axios.interceptors.request.use(
async (config) => { async (config) => {