import { takeEvery, put, call } from 'redux-saga/effects';
import { REQUEST_UCID_LOOKUP, RECEIVE_UCID_LOOKUP } from '../actionTypes';
export function* fetchUcid(action) {
try {
const response = yield call(
action.Api.ucidLookup,
action.requestParams,
action.searchTerm,
);
yield put({ type: RECEIVE_UCID_LOOKUP, response, status: 'success' });
} catch (error) {
yield put({ type: RECEIVE_UCID_LOOKUP, response: error, status: 'error' });
}
}
export default function* UcidLookupSaga() {
yield takeEvery(REQUEST_UCID_LOOKUP, fetchUcid);
}
|