1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Remove unnecessary function

This commit is contained in:
Chocobozzz 2022-01-18 11:37:29 +01:00
parent c1f7a737cf
commit e8bffe9690
No known key found for this signature in database
GPG key ID: 583A612D890159BE
15 changed files with 44 additions and 174 deletions

View file

@ -71,49 +71,34 @@ export class InstanceFollowService {
}
return this.authHttp.post(InstanceFollowService.BASE_APPLICATION_URL + '/following', body)
.pipe(
map(this.restExtractor.extractDataBool),
catchError(res => this.restExtractor.handleError(res))
)
.pipe(catchError(res => this.restExtractor.handleError(res)))
}
unfollow (follow: ActorFollow) {
const handle = follow.following.name + '@' + follow.following.host
return this.authHttp.delete(InstanceFollowService.BASE_APPLICATION_URL + '/following/' + handle)
.pipe(
map(this.restExtractor.extractDataBool),
catchError(res => this.restExtractor.handleError(res))
)
.pipe(catchError(res => this.restExtractor.handleError(res)))
}
acceptFollower (follow: ActorFollow) {
const handle = follow.follower.name + '@' + follow.follower.host
return this.authHttp.post(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}/accept`, {})
.pipe(
map(this.restExtractor.extractDataBool),
catchError(res => this.restExtractor.handleError(res))
)
.pipe(catchError(res => this.restExtractor.handleError(res)))
}
rejectFollower (follow: ActorFollow) {
const handle = follow.follower.name + '@' + follow.follower.host
return this.authHttp.post(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}/reject`, {})
.pipe(
map(this.restExtractor.extractDataBool),
catchError(res => this.restExtractor.handleError(res))
)
.pipe(catchError(res => this.restExtractor.handleError(res)))
}
removeFollower (follow: ActorFollow) {
const handle = follow.follower.name + '@' + follow.follower.host
return this.authHttp.delete(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}`)
.pipe(
map(this.restExtractor.extractDataBool),
catchError(res => this.restExtractor.handleError(res))
)
.pipe(catchError(res => this.restExtractor.handleError(res)))
}
}