[angular-16-irish-monitor | DONE | CHANGED] Search ORCID: change request to get the list of institutions

This commit is contained in:
argirok 2023-12-06 16:05:15 +02:00
parent 8c5c4923d3
commit 76003bf6d9
1 changed files with 15 additions and 12 deletions

View File

@ -35,19 +35,22 @@ export class SearchOrcidService {
//headers.append('Accept', 'application/orcid+json');
let headers = new HttpHeaders({'Accept': 'application/orcid+json'});
let url = properties.searchOrcidURL + term + '/record';
return this.http.get(url, { headers: headers })
//.map(res => res.json()['person'])
.pipe(map(res => res['person']))
.pipe(map(res => [res['name']['given-names'],
res['name']['family-name'],
res['name'], res['name']['institution-name']]))
let url ="https://pub.orcid.org/v3.0/expanded-search/?q=orcid:" + term + '&start=0&rows=50';
return this.http.get(url, {headers: headers})
.pipe(map(res => res['expanded-result']))
.pipe(map(res => {
let authors = []
SearchOrcidService.parseOrcidAuthor(res, [], authors, addId)
return authors.length > 0 ? authors[0] : null;
if(res) {
for (let auth_result of res) {
const author = {};
author['id'] = auth_result['orcid-id'];
author['authorGivenName'] = auth_result['given-names'];
author['authorFamilyName'] = auth_result['family-names'];
author['institutions'] = auth_result['institution-name'];
return author;
}
}
return null;
}));
}
searchOrcidAuthors(term: string,