[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:
parent
398deec477
commit
6e34d05a1d
|
@ -37,9 +37,8 @@ export class CommunityService {
|
||||||
setCommunity(community: CommunityInfo) {
|
setCommunity(community: CommunityInfo) {
|
||||||
this.community.next(community);
|
this.community.next(community);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO remove NEW from function names
|
getCommunity(communityId: string, refresh = false) {
|
||||||
getCommunityNew(communityId: string, refresh = false) {
|
|
||||||
if(!this.community.value || this.community.value.communityId !== communityId || refresh) {
|
if(!this.community.value || this.community.value.communityId !== communityId || refresh) {
|
||||||
this.promise = new Promise<any>((resolve, reject) => {
|
this.promise = new Promise<any>((resolve, reject) => {
|
||||||
this.sub = this.http.get<CommunityInfo>(properties.communityAPI + communityId)
|
this.sub = this.http.get<CommunityInfo>(properties.communityAPI + communityId)
|
||||||
|
@ -147,10 +146,10 @@ export class CommunityService {
|
||||||
}
|
}
|
||||||
|
|
||||||
isRIType(community: string): Observable<boolean> {
|
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> {
|
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'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue