[Library | Trunk]: Community Service remove new from getCommunityNew

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60459 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2021-02-19 18:08:49 +00:00
parent 398deec477
commit 6e34d05a1d
1 changed files with 4 additions and 5 deletions

View File

@ -37,9 +37,8 @@ export class CommunityService {
setCommunity(community: CommunityInfo) {
this.community.next(community);
}
// TODO remove NEW from function names
getCommunityNew(communityId: string, refresh = false) {
getCommunity(communityId: string, refresh = false) {
if(!this.community.value || this.community.value.communityId !== communityId || refresh) {
this.promise = new Promise<any>((resolve, reject) => {
this.sub = this.http.get<CommunityInfo>(properties.communityAPI + communityId)
@ -147,10 +146,10 @@ export class CommunityService {
}
isRIType(community: string): Observable<boolean> {
return this.getCommunityNew(community).pipe(map(community => community.type === 'ri'));
return this.getCommunity(community).pipe(map(community => community.type === 'ri'));
}
isCommunityType(community: string): Observable<boolean> {
return this.getCommunityNew(community).pipe(map(community => community.type === 'community'));
return this.getCommunity(community).pipe(map(community => community.type === 'community'));
}
}