%PDF- %PDF-
Direktori : /home/emergentqj/actioncivile/pre-auth/.632e77b3fb93bc8da5b589b869bc0037/static/js/sagas/ |
Current File : /home/emergentqj/actioncivile/pre-auth/.632e77b3fb93bc8da5b589b869bc0037/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); }