Add get subscriber's mail functionality
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@53912 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
da3582efd9
commit
0048098130
|
@ -14,6 +14,21 @@ export class SubscribeService {
|
|||
.map(res => <any> res.json()).do(res => {console.log(res)}).do(res => {console.log(res)});
|
||||
}
|
||||
|
||||
getCommunitySubscribersEmail(pid:string, url:string){
|
||||
return this.http.get(url+"/community/"+pid+"/subscribers")
|
||||
.map(res => <any> res.json()).map(res => this.parseCommunitySubscribers(res));
|
||||
}
|
||||
|
||||
parseCommunitySubscribers(data: any): String[] {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let resData = data[i];
|
||||
var email = new Array<string>();
|
||||
|
||||
email.push(resData[i].email);
|
||||
}
|
||||
return email;
|
||||
}
|
||||
|
||||
isSubscribedToCommunity(pid:string, email:string, url:string){
|
||||
return this.http.get(url+"/community/"+pid+"/subscribers")
|
||||
.map(res => ((<any>res =="")?{}:<any> res.json()))
|
||||
|
|
Loading…
Reference in New Issue