diff --git a/src/components/RequestBox/RequestBox.js b/src/components/RequestBox/RequestBox.js index f8b8228..a256b7a 100644 --- a/src/components/RequestBox/RequestBox.js +++ b/src/components/RequestBox/RequestBox.js @@ -79,7 +79,6 @@ export default class RequestBox extends Component { }; submitAction = async () => { - console.log("submitAction", this.state.request); if (!_.isEmpty(this.state.request)) { let response = await this.props.submitInfo( this.prepPrefetch(), @@ -92,7 +91,7 @@ export default class RequestBox extends Component { console.log("submitAction response", response); - if (!!response.systemActions && response.systemActions.length > 0) { + if (!!response && !!response.systemActions && response.systemActions.length > 0) { console.log("submitAction systemActions", response.systemActions); // find a resource in the system actions with the CRD coverage information extension diff --git a/src/containers/RequestBuilder.js b/src/containers/RequestBuilder.js index 494d661..e8cbe11 100644 --- a/src/containers/RequestBuilder.js +++ b/src/containers/RequestBuilder.js @@ -135,26 +135,6 @@ export default class RequestBuilder extends Component { }); this.consoleLog("Fetching response from " + cdsUrl, types.info); try { - // fetch(cdsUrl, { - // method: "POST", - // headers: myHeaders, - // body: JSON.stringify(json_request) - // }).then(response => { - // this.consoleLog("Received response", types.info); - // response.json().then((fhirResponse) => { - // console.log(fhirResponse); - // if (fhirResponse && fhirResponse.status) { - // this.consoleLog("Server returned status " - // + fhirResponse.status + ": " - // + fhirResponse.error, types.error); - // this.consoleLog(fhirResponse.message, types.error); - // } else { - // this.setState({ response: fhirResponse }); - // } - // this.setState({ loading: false }); - // }) - // }).catch(() => this.consoleLog("No response recieved from the server", types.error)); - try { let response = await fetch(cdsUrl, { method: "POST",