From b3e5a0a947d1d69bcc76550c8cc2df91203c13fe Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 10 Feb 2021 09:36:39 +0000 Subject: [PATCH] [Trunk | Library]: searchResearchResults.service.ts: Add method "searchForMyOrcidLinks()". (update of file missing from commit r60394 (where my-orcid-links folder was added). git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60398 d315682c-612b-4755-9ff5-7f18f6832af3 --- services/searchResearchResults.service.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/services/searchResearchResults.service.ts b/services/searchResearchResults.service.ts index 75376485..932acfa8 100644 --- a/services/searchResearchResults.service.ts +++ b/services/searchResearchResults.service.ts @@ -6,6 +6,7 @@ import {Dates, DOI, StringUtils} from '../utils/string-utils.class'; import {ParsingFunctions} from '../landingPages/landing-utils/parsingFunctions.class'; import {EnvProperties} from '../utils/properties/env-properties'; import {map} from "rxjs/operators"; +import {properties} from "../../../environments/environment"; @Injectable() @@ -157,6 +158,18 @@ export class SearchResearchResultsService { .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties)])); } + searchForMyOrcidLinks (resultType:string, orcidQuery: string, typeQuery: string, page: number, size: number):any { + let url = properties.searchAPIURLLAst+"resources2/?format=json"; + if(orcidQuery!= null && orcidQuery != '' ) { + url +="&query=(" + orcidQuery + ")"; + } + url += typeQuery; + url += "&page="+(page-1)+"&size="+size; + + return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) + .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties)])); + } + parseResults(resultType:string, data: any, properties: EnvProperties): SearchResult[] { let results: SearchResult[] = [];