ih-black-lion
Version:
State handler for Arus projects
31 lines (28 loc) • 585 B
JavaScript
import {
takeEvery,
put,
call
} from 'redux-saga/effects';
import {
REQUEST_TG,
RECEIVE_TG
} from '../actionTypes';
export function* fetchTuitionGuarantee(action) {
try {
const response = yield call(action.Api.getTuitionGuarantee, action.requestParams);
yield put({
type: RECEIVE_TG,
response,
status: 'success'
});
} catch (error) {
yield put({
type: RECEIVE_TG,
response: error,
status: 'error'
});
}
}
export default function* TuitionGuaranteeSaga() {
yield takeEvery(REQUEST_TG, fetchTuitionGuarantee);
}