[angular-16-irish-monitor | WIP | CHANGED] Orcid search author: parse institutions

This commit is contained in:
argirok 2023-11-14 15:08:50 +02:00
parent edda550b63
commit 5480de5812
1 changed files with 9 additions and 2 deletions

View File

@ -25,7 +25,7 @@ export class SearchOrcidService {
.pipe(map(res => res['person']))
.pipe(map(res => [res['name']['given-names'],
res['name']['family-name'],
res['name']]))
res['name'], res['name']['institution-name']]))
.pipe(map(res => SearchOrcidService.parseOrcidAuthor(res, authorIds, authors, addId)));
}
@ -42,7 +42,7 @@ export class SearchOrcidService {
.pipe(map(res => res['person']))
.pipe(map(res => [res['name']['given-names'],
res['name']['family-name'],
res['name']]))
res['name'], res['name']['institution-name']]))
.pipe(map(res => {
let authors = []
@ -86,6 +86,7 @@ export class SearchOrcidService {
author['id'] = auth_result['orcid-id'];
author['authorGivenName'] = auth_result['given-names'];
author['authorFamilyName'] = auth_result['family-names'];
author['institutions'] = auth_result['institution-name'];
authors.push(author);
}
}
@ -104,6 +105,7 @@ export class SearchOrcidService {
static parseOrcidAuthor(data: any, authorIds: string[], authors, addId): any {
console.log(data)
if (data[2] != null) {
if (addId) {
authorIds.push(data[2].path);
@ -120,7 +122,12 @@ export class SearchOrcidService {
} else {
author['authorFamilyName'] = "";
}
if (data[3] != null) {
author['institution'] = data[3];
}
console.log(author['institution'])
authors.push(author);
return true;
}
return false;