.then(() => { fetch(url, h.fetchPost(state.config.csrf, data, 'POST')) .then((response) => { if (!response.ok) { dispatch(setErrors(['An error occurred.'])); } return response.json(); }) .then(() => setTimeout(() => dispatch(getExecuteStatus()), 3000)); });
return (dispatch, getState) => { let state = getState(), patch = formatOutgoingRiskOfBias(state, scores), opts = h.fetchPost(state.config.csrf, patch, 'PUT'); dispatch(resetError()); return fetch( `${h.getObjectUrl( state.config.host, state.config.riskofbias.url, state.config.riskofbias.id )}`, opts ) .then((response) => response.json()) .then((json) => dispatch(updateFinalScores(json.scores))) .then(() => (window.location.href = state.config.cancelUrl)) .catch((ex) => dispatch(setError(ex))); };
}).then(() => { fetch(url, h.fetchPost(state.config.csrf, data, 'POST')).then(() => dispatch(setSelectedModel(model_id, notes)) ); });