Skip to content
Snippets Groups Projects
Commit 5aef7966 authored by Audrey Hamelers's avatar Audrey Hamelers
Browse files

Merge branch 'shared-data-model' into sticky-footer

* shared-data-model:
  #455
parents feda477f ab83831a
No related branches found
No related tags found
3 merge requests!108Dev,!107Shared data model,!106Sticky footer
......@@ -204,16 +204,18 @@ class PubMedSearch extends React.Component {
async onSelected(result, journal) {
const inPMC = result.articleids.find(id => id.idtype === 'pmc')
if (inPMC) {
this.setState({ loading: true })
const obj = {
inPMC: result.title,
pmcid: inPMC.value,
loading: false,
}
const epmcURL = `https://www.ebi.ac.uk/europepmc/webservices/rest/search?query=SRC:MED%20EXT_ID:${
result.uid
}&resulttype=lite&format=json`
const response = await fetch(epmcURL)
const json = await response.json()
const epmc = json.resultList.result[0].inEPMC
const epmc = json.resultList.result[0] && json.resultList.result[0].inEPMC
if (epmc === 'Y') {
obj.inEPMC = true
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment