From 4189a8f11449b832d354d3143fd6aa3f57b8f836 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 31 Aug 2020 11:33:48 +0000 Subject: [PATCH] [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 --- services/user-registry.service.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/services/user-registry.service.ts b/services/user-registry.service.ts index 55fc2b58..2218b07d 100644 --- a/services/user-registry.service.ts +++ b/services/user-registry.service.ts @@ -26,6 +26,28 @@ export class UserRegistryService { return this.http.post(properties.registryUrl + 'unsubscribe/' + encodeURIComponent(type) + '/' + encodeURIComponent(id), null, CustomOptions.registryOptions()) } + + public removeManagerRole(type: string, id: string, email: string): Observable { + return this.http.delete(properties.registryUrl + + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/manager/' + encodeURIComponent(email), CustomOptions.registryOptions()); + } + + public invite(type: string, id: string, email: string): Observable { + return this.http.post(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 { + return this.http.delete(properties.registryUrl + 'invite/' + + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/manager/' + encodeURIComponent(email), + CustomOptions.registryOptions()); + } + + public getPendingManagers(type: string, id: string): Observable { + return this.http.get(properties.registryUrl + 'invite/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/managers/', + CustomOptions.registryOptions()).pipe(map((response: any) => response.response)); + } public getSubscribers(type: string, id: string): Observable { return this.http.get(properties.registryUrl + encodeURIComponent(type) + '/' + encodeURIComponent(id) + '/subscribers/').pipe(map(response => response.response));