%PDF- %PDF-
Direktori : /home/emergentqj/actioncivile/pre-auth/.4cc3a2e1590a4463a5f392ddcc26929e/static/js/sagas/ |
Current File : /home/emergentqj/actioncivile/pre-auth/.4cc3a2e1590a4463a5f392ddcc26929e/static/js/sagas/scramblePhone.js |
import { put, call, takeEvery } from "redux-saga/effects"; import configFunc from "config/config"; import LIST_ACTIONS from "../constants/action_types"; import { postDataAction } from "../common/actions"; const config = configFunc(); function* runScramblePhone(action) { const sendOtpUrl = `${config.apiUrl}login/scramblephone`; try { yield call( postDataAction(sendOtpUrl, action.data, false, { "Content-Type": "application/json", }), ); yield put({ type: LIST_ACTIONS.SCRAMBLE_PHONE_SUCCESS, }); } catch (e) { yield put({ type: LIST_ACTIONS.SCRAMBLE_PHONE_FAILURE, }); } } export default function* scramblePhone() { yield takeEvery(LIST_ACTIONS.SCRAMBLE_PHONE, runScramblePhone); }