[Trunk | Library]: subscribe.service.ts: Method "isSubscribedToCommunity()":
a. get request, not post. b. Method "getCommunitiesSubscribedTo()" remove email parameter and add token in header ("X-XSRF-TOKEN" header) - Do not reveal user's email. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58461 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
71a4d35c43
commit
9433f3b350
|
@ -23,7 +23,7 @@ export class SubscribeService {
|
||||||
|
|
||||||
isSubscribedToCommunity(properties: EnvProperties, pid: string) {
|
isSubscribedToCommunity(properties: EnvProperties, pid: string) {
|
||||||
let url = properties.adminToolsAPIURL + "/community/" + pid + "/is-subscriber/";
|
let url = properties.adminToolsAPIURL + "/community/" + pid + "/is-subscriber/";
|
||||||
return this.http.post<boolean>(url, {}, CustomOptions.getAuthOptionsWithBody())
|
return this.http.get<boolean>(url, CustomOptions.getAuthOptionsWithBody())
|
||||||
.pipe(map(res => {
|
.pipe(map(res => {
|
||||||
// if (res['status'] && res['status'] != 200) {
|
// if (res['status'] && res['status'] != 200) {
|
||||||
// return null;
|
// return null;
|
||||||
|
@ -58,8 +58,8 @@ export class SubscribeService {
|
||||||
return this.http.post<any>(properties.adminToolsAPIURL + "/community/" + pid + "/subscribers/delete", JSON.stringify([email]), CustomOptions.getAuthOptionsWithBody());
|
return this.http.post<any>(properties.adminToolsAPIURL + "/community/" + pid + "/subscribers/delete", JSON.stringify([email]), CustomOptions.getAuthOptionsWithBody());
|
||||||
}
|
}
|
||||||
|
|
||||||
getCommunitiesSubscribedTo(properties: EnvProperties, email: string) {
|
getCommunitiesSubscribedTo(properties: EnvProperties/*, email: string*/) {
|
||||||
let url = properties.adminToolsAPIURL + "/subscriber/communities?email=" + email;
|
let url = properties.adminToolsAPIURL + "/subscriber/communities";//?email=" + email;
|
||||||
return this.http.get<any>((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url);
|
return this.http.get<any>(url, CustomOptions.getAuthOptionsWithBody());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue