%PDF- %PDF-
Mini Shell

Mini Shell

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

Zerion Mini Shell 1.0