{"size": 796, "ext": "js", "max_stars_repo_path": ".history/app/containers/InvitationForm/saga_20191030135246.js", "max_stars_repo_name": "masoodalamhunzai/Multiple-Emails-Invitation-React", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": ".history/app/containers/InvitationForm/saga_20191030135246.js", "max_issues_repo_name": "masoodalamhunzai/Multiple-Emails-Invitation-React", "max_issues_repo_issues_event_min_datetime": "2020-04-06T21:34:29.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-25T18:02:06.000Z", "max_forks_repo_path": ".history/app/containers/InvitationForm/saga_20191030135247.js", "max_forks_repo_name": "masoodalamhunzai/Multiple-Emails-Invitation-React", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 7, "max_forks_count": null, "avg_line_length": 30.6153846154, "max_line_length": 106, "alphanum_fraction": 0.6959798995}
import { takeLatest, call, put, select } from 'redux-saga/effects';
import * as c from './constants';
import * as a from './actions';
import { sendInvitationApi } from './api';


export default function* sentInvitations(action) {
  try {
    const {payload} = action;
    const response = yield call(sendInvitationApi,payload);
    yield put(a.setResponse({status:response.status,message:response.message}));
    
  } catch (error) {
    if(error.response){
      yield put(a.setResponse({status:error.response.status,message:'Operation failed, try agin later'}));
    }else{
      yield put(a.setResponse({status:0,message:'Something went wrong'}));
    }
  }
}

// Individual exports for testing
export default function* invitationFormSaga() {
  // See example in containers/HomePage/saga.js
}
