aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-instance
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-instance')
-rw-r--r--client/src/app/shared/shared-instance/instance-follow.service.ts25
1 files changed, 5 insertions, 20 deletions
diff --git a/client/src/app/shared/shared-instance/instance-follow.service.ts b/client/src/app/shared/shared-instance/instance-follow.service.ts
index a6799d3e1..a83f7c4ad 100644
--- a/client/src/app/shared/shared-instance/instance-follow.service.ts
+++ b/client/src/app/shared/shared-instance/instance-follow.service.ts
@@ -71,49 +71,34 @@ export class InstanceFollowService {
71 } 71 }
72 72
73 return this.authHttp.post(InstanceFollowService.BASE_APPLICATION_URL + '/following', body) 73 return this.authHttp.post(InstanceFollowService.BASE_APPLICATION_URL + '/following', body)
74 .pipe( 74 .pipe(catchError(res => this.restExtractor.handleError(res)))
75 map(this.restExtractor.extractDataBool),
76 catchError(res => this.restExtractor.handleError(res))
77 )
78 } 75 }
79 76
80 unfollow (follow: ActorFollow) { 77 unfollow (follow: ActorFollow) {
81 const handle = follow.following.name + '@' + follow.following.host 78 const handle = follow.following.name + '@' + follow.following.host
82 79
83 return this.authHttp.delete(InstanceFollowService.BASE_APPLICATION_URL + '/following/' + handle) 80 return this.authHttp.delete(InstanceFollowService.BASE_APPLICATION_URL + '/following/' + handle)
84 .pipe( 81 .pipe(catchError(res => this.restExtractor.handleError(res)))
85 map(this.restExtractor.extractDataBool),
86 catchError(res => this.restExtractor.handleError(res))
87 )
88 } 82 }
89 83
90 acceptFollower (follow: ActorFollow) { 84 acceptFollower (follow: ActorFollow) {
91 const handle = follow.follower.name + '@' + follow.follower.host 85 const handle = follow.follower.name + '@' + follow.follower.host
92 86
93 return this.authHttp.post(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}/accept`, {}) 87 return this.authHttp.post(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}/accept`, {})
94 .pipe( 88 .pipe(catchError(res => this.restExtractor.handleError(res)))
95 map(this.restExtractor.extractDataBool),
96 catchError(res => this.restExtractor.handleError(res))
97 )
98 } 89 }
99 90
100 rejectFollower (follow: ActorFollow) { 91 rejectFollower (follow: ActorFollow) {
101 const handle = follow.follower.name + '@' + follow.follower.host 92 const handle = follow.follower.name + '@' + follow.follower.host
102 93
103 return this.authHttp.post(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}/reject`, {}) 94 return this.authHttp.post(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}/reject`, {})
104 .pipe( 95 .pipe(catchError(res => this.restExtractor.handleError(res)))
105 map(this.restExtractor.extractDataBool),
106 catchError(res => this.restExtractor.handleError(res))
107 )
108 } 96 }
109 97
110 removeFollower (follow: ActorFollow) { 98 removeFollower (follow: ActorFollow) {
111 const handle = follow.follower.name + '@' + follow.follower.host 99 const handle = follow.follower.name + '@' + follow.follower.host
112 100
113 return this.authHttp.delete(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}`) 101 return this.authHttp.delete(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}`)
114 .pipe( 102 .pipe(catchError(res => this.restExtractor.handleError(res)))
115 map(this.restExtractor.extractDataBool),
116 catchError(res => this.restExtractor.handleError(res))
117 )
118 } 103 }
119} 104}