%PDF- %PDF-
Direktori : /home/emergentqj/actioncivile/pre-auth/.4cc3a2e1590a4463a5f392ddcc26929e/static/js/sagas/ |
Current File : /home/emergentqj/actioncivile/pre-auth/.4cc3a2e1590a4463a5f392ddcc26929e/static/js/sagas/getCheckExistingUser.js |
// import configFunc from "config/config" import { put, takeEvery } from "redux-saga/effects"; import LIST_ACTIONS from "../constants/action_types"; // const config = configFunc(); function* runGetCheckExistingUser(_, action) { // const isBusinessFlow = action.payload // && action.payload.isBusinessFlow // && action.payload.isBusinessFlow === true // ? "true" // : "false"; // const url = `${ // config.apiUrl // }checkexists?isBusinessFlow=${isBusinessFlow}&phonenumber=${encodeURIComponent( // action.payload.phoneNumber, // )}`; try { // const payload = yield call(getDataAction(url, false)); yield put({ type: LIST_ACTIONS.GET_CHECK_EXISTING_USER_SUCCESS, // TODO: return as if user not found. work later on proper removal (Janno) // payload: payload.data, payload: { isKnownUser: false, phoneNumber: action.payload.phoneNumber, parkingUser: null, parkings: false, customerId: null, note: "profiles count: 0", }, }); } catch (error) { yield put({ type: LIST_ACTIONS.GET_CHECK_EXISTING_USER_ERROR, error, }); } } export default function* getCheckExistingUser(dispatch) { yield takeEvery( LIST_ACTIONS.GET_CHECK_EXISTING_USER_REQUEST, runGetCheckExistingUser, dispatch, ); }