[Library | Trunk]: Remove deprecated from getCommunity, add methods on user registry service
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59348 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
4961caba76
commit
6d593aaa27
|
@ -41,9 +41,6 @@ export class CommunityService {
|
||||||
return from(this.getCommunityByStateAsync(properties, url));
|
return from(this.getCommunityByStateAsync(properties, url));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
getCommunity(properties: EnvProperties, url: string) {
|
getCommunity(properties: EnvProperties, url: string) {
|
||||||
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
|
||||||
.pipe(map(res => this.parseCommunity(res)));
|
.pipe(map(res => this.parseCommunity(res)));
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {HttpClient} from '@angular/common/http';
|
import {HttpClient} from '@angular/common/http';
|
||||||
import {Observable, of} from "rxjs";
|
import {Observable} from 'rxjs';
|
||||||
import {properties} from "../../../environments/environment";
|
import {properties} from '../../../environments/environment';
|
||||||
import {CustomOptions} from "./servicesUtils/customOptions.class";
|
import {CustomOptions} from './servicesUtils/customOptions.class';
|
||||||
import {catchError, map} from "rxjs/operators";
|
import {map} from 'rxjs/operators';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
@ -19,12 +19,12 @@ export class UserRegistryService {
|
||||||
|
|
||||||
public subscribeTo(type: string, id: string): Observable<any> {
|
public subscribeTo(type: string, id: string): Observable<any> {
|
||||||
return this.http.post(properties.registryUrl + 'subscribe/' + encodeURIComponent(type) + '/' + encodeURIComponent(id),
|
return this.http.post(properties.registryUrl + 'subscribe/' + encodeURIComponent(type) + '/' + encodeURIComponent(id),
|
||||||
null, CustomOptions.registryOptions())
|
null, CustomOptions.registryOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsubscribeFrom(type: string, id: string): Observable<any> {
|
public unsubscribeFrom(type: string, id: string): Observable<any> {
|
||||||
return this.http.post(properties.registryUrl + 'unsubscribe/' + encodeURIComponent(type) + '/' + encodeURIComponent(id),
|
return this.http.post(properties.registryUrl + 'unsubscribe/' + encodeURIComponent(type) + '/' + encodeURIComponent(id),
|
||||||
null, CustomOptions.registryOptions())
|
null, CustomOptions.registryOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
public removeManagerRole(type: string, id: string, email: string): Observable<any> {
|
public removeManagerRole(type: string, id: string, email: string): Observable<any> {
|
||||||
|
@ -32,9 +32,9 @@ export class UserRegistryService {
|
||||||
encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/manager/' + encodeURIComponent(email), CustomOptions.registryOptions());
|
encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/manager/' + encodeURIComponent(email), CustomOptions.registryOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
public invite(type: string, id: string, email: string): Observable<any[]> {
|
public invite(type: string, id: string, email: string, details: any): Observable<any[]> {
|
||||||
return this.http.post<any>(properties.registryUrl + 'invite/' +
|
return this.http.post<any>(properties.registryUrl + 'invite/' +
|
||||||
encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/manager/' + encodeURIComponent(email), null,
|
encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/manager/' + encodeURIComponent(email), details,
|
||||||
CustomOptions.registryOptions()).pipe(map((response: any) => response.response));
|
CustomOptions.registryOptions()).pipe(map((response: any) => response.response));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,16 +62,16 @@ export class UserRegistryService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public getInvitation(id: string): Observable<any> {
|
public getInvitation(id: string): Observable<any> {
|
||||||
return this.http.get<any>(properties.registryUrl + "verification/" + encodeURIComponent(id), CustomOptions.registryOptions())
|
return this.http.get<any>(properties.registryUrl + 'verification/' + encodeURIComponent(id), CustomOptions.registryOptions())
|
||||||
.pipe(map((response: any) => response.response));
|
.pipe(map((response: any) => response.response));
|
||||||
}
|
}
|
||||||
|
|
||||||
public verify(id: string, code: string): Observable<any> {
|
public verify(id: string, code: string): Observable<any> {
|
||||||
return this.http.post<any>(properties.registryUrl + "verification/" + encodeURIComponent(id), code,CustomOptions.registryOptions());
|
return this.http.post<any>(properties.registryUrl + 'verification/' + encodeURIComponent(id), code, CustomOptions.registryOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
public deleteVerification(id: string): Observable<any> {
|
public deleteVerification(id: string): Observable<any> {
|
||||||
return this.http.delete<any>(properties.registryUrl + "verification/" + encodeURIComponent(id), CustomOptions.registryOptions());
|
return this.http.delete<any>(properties.registryUrl + 'verification/' + encodeURIComponent(id), CustomOptions.registryOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
public getManagersEmail(type: string, id: string): Observable<any[]> {
|
public getManagersEmail(type: string, id: string): Observable<any[]> {
|
||||||
|
|
Loading…
Reference in New Issue