import { takeEvery, put, call } from 'redux-saga/effects';
import { REQUEST_APPLICATIONS, RECEIVE_APPLICATIONS } from '../actionTypes';
export function* fetchApplications(action) {
try {
const response = yield call(action.Api.getApplications, action.requestParms);
yield put({ type: RECEIVE_APPLICATIONS, response, status: 'success' });
} catch (error) {
yield put({ type: RECEIVE_APPLICATIONS, response: error, status: 'error' });
}
}
export default function* ApplicationsSaga() {
yield takeEvery(REQUEST_APPLICATIONS, fetchApplications);
}
|