Skip to content
Snippets Groups Projects

Dev

Merged lit_git requested to merge dev into master
1 file
+ 3
1
Compare changes
  • Side-by-side
  • Inline
@@ -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
}