All files / sagas CourseHistorySaga.js

0% Statements 0/28
0% Branches 0/9
0% Functions 0/4
0% Lines 0/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22                                           
import { takeEvery, put, call } from 'redux-saga/effects';
import { REQUEST_COURSEHISTORY, RECEIVE_COURSEHISTORY } from '../actionTypes';
 
export function* fetchCourseHistory(action) {
  try {
    const response = yield call(
      action.Api.getCourseHistory,
      action.requestParms,
      action.term,
      action.mode,
      action.acaCareer,
    );
    yield put({ type: RECEIVE_COURSEHISTORY, response, status: 'success' });
  } catch (error) {
    yield put({ type: RECEIVE_COURSEHISTORY, response: error, status: 'error' });
  }
}
 
export default function* CourseHistorySaga() {
  yield takeEvery(REQUEST_COURSEHISTORY, fetchCourseHistory);
}