%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/sendLicensePlate.js

import { put, call, takeEvery } from "redux-saga/effects";

import configFunc from "config/config";
import LIST_ACTIONS from "constants/action_types";
import { postDataAction2 } from "../common/actions";

const config = configFunc();

function* runSendLicensePlate(action) {
  const sendLicensePlateUrl = `${config.apiUrl}login/isvalidlicenseplate`;
  try {
    yield call(
      postDataAction2({
        url: sendLicensePlateUrl,
        params: {
          phoneNumber: action.data.phoneNumber,
          licensePlate: action.data.licensePlate,
          pendingAccessToken: action.data.pendingAccessToken,
        },
        auth: true,
      }),
    );

    yield put({ type: LIST_ACTIONS.SEND_LICENSE_PLATE_SUCCESS });
  } catch (e) {
    const { data } = e.response || {};

    yield put({
      type: LIST_ACTIONS.SEND_LICENSE_PLATE_ERROR,
      payload: data,
    });
  }
}

export default function* sendLicensePlate() {
  yield takeEvery(LIST_ACTIONS.SEND_LICENSE_PLATE_REQUEST, runSendLicensePlate);
}

Zerion Mini Shell 1.0