From 9433f3b350795ff29f8ec5bb4faf7ce389460e2f Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Fri, 10 Apr 2020 06:09:15 +0000 Subject: [PATCH] [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 --- utils/subscribe/subscribe.service.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/subscribe/subscribe.service.ts b/utils/subscribe/subscribe.service.ts index adfb30f8..f6597e2e 100644 --- a/utils/subscribe/subscribe.service.ts +++ b/utils/subscribe/subscribe.service.ts @@ -23,7 +23,7 @@ export class SubscribeService { isSubscribedToCommunity(properties: EnvProperties, pid: string) { let url = properties.adminToolsAPIURL + "/community/" + pid + "/is-subscriber/"; - return this.http.post(url, {}, CustomOptions.getAuthOptionsWithBody()) + return this.http.get(url, CustomOptions.getAuthOptionsWithBody()) .pipe(map(res => { // if (res['status'] && res['status'] != 200) { // return null; @@ -58,8 +58,8 @@ export class SubscribeService { return this.http.post(properties.adminToolsAPIURL + "/community/" + pid + "/subscribers/delete", JSON.stringify([email]), CustomOptions.getAuthOptionsWithBody()); } - getCommunitiesSubscribedTo(properties: EnvProperties, email: string) { - let url = properties.adminToolsAPIURL + "/subscriber/communities?email=" + email; - return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url); + getCommunitiesSubscribedTo(properties: EnvProperties/*, email: string*/) { + let url = properties.adminToolsAPIURL + "/subscriber/communities";//?email=" + email; + return this.http.get(url, CustomOptions.getAuthOptionsWithBody()); } }