%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/getProductPackage.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";
import { getUniversalCookies } from "../utils/cookies";

const config = configFunc();
// TODO investigate is it in use
function* runGetProductPackage() {
  const getSpecEnabledUrl = `${config.apiUrl}parkingusers/${getUniversalCookies().get(
    "userId",
  )}/subscription`;

  try {
    const payload = yield call(getDataAction(getSpecEnabledUrl, null, true));

    yield put({
      type: LIST_ACTIONS.GET_PRODUCT_PACKAGE_SUCCESS,
      payload: payload.data.productPackage,
    });
  } catch (e) {
    yield put({
      type: LIST_ACTIONS.GET_PRODUCT_PACKAGE_ERROR,
      e,
    });
  }
}

export default function* getSpecEnabled(dispatch) {
  yield takeEvery(
    LIST_ACTIONS.GET_PRODUCT_PACKAGE_REQUEST,
    runGetProductPackage,
    dispatch,
  );
}

Zerion Mini Shell 1.0