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

#455

parent 0d6c52da
No related branches found
No related tags found
2 merge requests!102Shared data model,!103Dev
......@@ -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