[Library | Trunk]

update parsing for doi - add check if it is array and get value when it is not



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60159 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2020-12-17 13:41:07 +00:00
parent d738597882
commit 75e2d6bcdc
1 changed files with 12 additions and 4 deletions

View File

@ -183,10 +183,18 @@ export class SearchResearchResultsService {
}
/////////////////////////// Athena Code ///////////////////////////
if(resData['pid']) {
for(let i=0; i<resData['pid'].length; i++){
if(resData['pid'][i].classid == 'doi'){
if(resData['pid'][i].content != '' && resData['pid'][i].content != null){
result.DOIs.push(resData['pid'][i].content.replace("https://doi.org/",""));
if(!Array.isArray(resData['pid'])) {
if(resData['pid'].classid && resData['pid'].classid == 'doi'){
if(resData['pid'].content != '' && resData['pid'].content != null){
result.DOIs.push(resData['pid'].content.replace("https://doi.org/",""));
}
}
} else {
for(let i=0; i<resData['pid'].length; i++){
if(resData['pid'][i].classid == 'doi'){
if(resData['pid'][i].content != '' && resData['pid'][i].content != null){
result.DOIs.push(resData['pid'][i].content.replace("https://doi.org/",""));
}
}
}
}