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