From 0dc647775881eb1378b213a530996cd096de24ea Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 8 Apr 2019 15:47:44 +0200 Subject: Add delete/manual approval instance followers in client --- .../app/+admin/follows/shared/follow.service.ts | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'client/src/app/+admin/follows/shared') diff --git a/client/src/app/+admin/follows/shared/follow.service.ts b/client/src/app/+admin/follows/shared/follow.service.ts index a2904179e..c2b8ef006 100644 --- a/client/src/app/+admin/follows/shared/follow.service.ts +++ b/client/src/app/+admin/follows/shared/follow.service.ts @@ -63,4 +63,34 @@ export class FollowService { catchError(res => this.restExtractor.handleError(res)) ) } + + acceptFollower (follow: ActorFollow) { + const handle = follow.follower.name + '@' + follow.follower.host + + return this.authHttp.post(`${FollowService.BASE_APPLICATION_URL}/followers/${handle}/accept`, {}) + .pipe( + map(this.restExtractor.extractDataBool), + catchError(res => this.restExtractor.handleError(res)) + ) + } + + rejectFollower (follow: ActorFollow) { + const handle = follow.follower.name + '@' + follow.follower.host + + return this.authHttp.post(`${FollowService.BASE_APPLICATION_URL}/followers/${handle}/reject`, {}) + .pipe( + map(this.restExtractor.extractDataBool), + catchError(res => this.restExtractor.handleError(res)) + ) + } + + removeFollower (follow: ActorFollow) { + const handle = follow.follower.name + '@' + follow.follower.host + + return this.authHttp.delete(`${FollowService.BASE_APPLICATION_URL}/followers/${handle}`) + .pipe( + map(this.restExtractor.extractDataBool), + catchError(res => this.restExtractor.handleError(res)) + ) + } } -- cgit v1.2.3