Merge Angular 16 Irish Monitor to develop #33
|
@ -35,19 +35,22 @@ export class SearchOrcidService {
|
||||||
//headers.append('Accept', 'application/orcid+json');
|
//headers.append('Accept', 'application/orcid+json');
|
||||||
let headers = new HttpHeaders({'Accept': 'application/orcid+json'});
|
let headers = new HttpHeaders({'Accept': 'application/orcid+json'});
|
||||||
|
|
||||||
let url = properties.searchOrcidURL + term + '/record';
|
let url ="https://pub.orcid.org/v3.0/expanded-search/?q=orcid:" + term + '&start=0&rows=50';
|
||||||
|
|
||||||
return this.http.get(url, {headers: headers})
|
return this.http.get(url, {headers: headers})
|
||||||
//.map(res => res.json()['person'])
|
.pipe(map(res => res['expanded-result']))
|
||||||
.pipe(map(res => res['person']))
|
|
||||||
.pipe(map(res => [res['name']['given-names'],
|
|
||||||
res['name']['family-name'],
|
|
||||||
res['name'], res['name']['institution-name']]))
|
|
||||||
|
|
||||||
.pipe(map(res => {
|
.pipe(map(res => {
|
||||||
let authors = []
|
if(res) {
|
||||||
SearchOrcidService.parseOrcidAuthor(res, [], authors, addId)
|
for (let auth_result of res) {
|
||||||
return authors.length > 0 ? authors[0] : null;
|
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,
|
searchOrcidAuthors(term: string,
|
||||||
|
|
Loading…
Reference in New Issue