%PDF- %PDF-
Direktori : /home/emergentqj/actioncivile/pre-auth/.4cc3a2e1590a4463a5f392ddcc26929e/static/js/sagas/ |
Current File : /home/emergentqj/actioncivile/pre-auth/.4cc3a2e1590a4463a5f392ddcc26929e/static/js/sagas/getPaymentMethod.js |
import { put, call, takeEvery } from "redux-saga/effects"; import configFunc from "config/config"; import LIST_ACTIONS from "../constants/action_types"; import { getDataAction } from "../common/actions"; const config = configFunc(); function* runGetPaymentMethod() { const getPaymentMethodUrl = `${config.apiUrl}payment/paymentmethod`; try { const payload = yield call(getDataAction(getPaymentMethodUrl, null, true)); yield put({ type: LIST_ACTIONS.GET_PAYMENT_METHOD_SUCCESS, payload, }); } catch (e) { yield put({ type: LIST_ACTIONS.GET_PAYMENT_METHOD_ERROR, e, }); } } export default function* getPaymentMethod(dispatch) { yield takeEvery( LIST_ACTIONS.GET_PAYMENT_METHOD_REQUEST, runGetPaymentMethod, dispatch, ); }