Project

General

Profile

« Previous | Next » 

Revision 58461

[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.

View differences:

subscribe.service.ts
23 23

  
24 24
  isSubscribedToCommunity(properties: EnvProperties, pid: string) {
25 25
    let url = properties.adminToolsAPIURL + "/community/" + pid + "/is-subscriber/";
26
    return this.http.post<boolean>(url, {}, CustomOptions.getAuthOptionsWithBody())
26
    return this.http.get<boolean>(url, CustomOptions.getAuthOptionsWithBody())
27 27
      .pipe(map(res => {
28 28
        // if (res['status'] && res['status'] != 200) {
29 29
        //   return null;
......
58 58
    return this.http.post<any>(properties.adminToolsAPIURL + "/community/" + pid + "/subscribers/delete", JSON.stringify([email]), CustomOptions.getAuthOptionsWithBody());
59 59
  }
60 60

  
61
  getCommunitiesSubscribedTo(properties: EnvProperties, email: string) {
62
    let url = properties.adminToolsAPIURL + "/subscriber/communities?email=" + email;
63
    return this.http.get<any>((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url);
61
  getCommunitiesSubscribedTo(properties: EnvProperties/*, email: string*/) {
62
    let url = properties.adminToolsAPIURL + "/subscriber/communities";//?email=" + email;
63
    return this.http.get<any>(url, CustomOptions.getAuthOptionsWithBody());
64 64
  }
65 65
}

Also available in: Unified diff