[Library | trunk]: 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@59315 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2020-08-31 11:33:48 +00:00
parent 530a441f4a
commit 4189a8f114
1 changed files with 22 additions and 0 deletions

View File

@ -27,6 +27,28 @@ export class UserRegistryService {
null, CustomOptions.registryOptions()) null, CustomOptions.registryOptions())
} }
public removeManagerRole(type: string, id: string, email: string): Observable<any> {
return this.http.delete<any>(properties.registryUrl +
encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/manager/' + encodeURIComponent(email), CustomOptions.registryOptions());
}
public invite(type: string, id: string, email: string): Observable<any[]> {
return this.http.post<any>(properties.registryUrl + 'invite/' +
encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/manager/' + encodeURIComponent(email), null,
CustomOptions.registryOptions()).pipe(map((response: any) => response.response));
}
public cancelInvitation(type: string, id: string, email: string): Observable<any> {
return this.http.delete<any>(properties.registryUrl + 'invite/' +
encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/manager/' + encodeURIComponent(email),
CustomOptions.registryOptions());
}
public getPendingManagers(type: string, id: string): Observable<any[]> {
return this.http.get<any>(properties.registryUrl + 'invite/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/managers/',
CustomOptions.registryOptions()).pipe(map((response: any) => response.response));
}
public getSubscribers(type: string, id: string): Observable<any[]> { public getSubscribers(type: string, id: string): Observable<any[]> {
return this.http.get<any>(properties.registryUrl + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/subscribers/').pipe(map(response => response.response)); return this.http.get<any>(properties.registryUrl + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/subscribers/').pipe(map(response => response.response));
} }