diff options
Diffstat (limited to 'client/src/app/+admin/users/shared/user.service.ts')
-rw-r--r-- | client/src/app/+admin/users/shared/user.service.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/client/src/app/+admin/users/shared/user.service.ts b/client/src/app/+admin/users/shared/user.service.ts index 1af1e4ef2..ad7fb1eee 100644 --- a/client/src/app/+admin/users/shared/user.service.ts +++ b/client/src/app/+admin/users/shared/user.service.ts | |||
@@ -59,6 +59,18 @@ export class UserService { | |||
59 | .pipe(catchError(err => this.restExtractor.handleError(err))) | 59 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
60 | } | 60 | } |
61 | 61 | ||
62 | banUser (user: User, reason?: string) { | ||
63 | const body = reason ? { reason } : {} | ||
64 | |||
65 | return this.authHttp.post(UserService.BASE_USERS_URL + user.id + '/block', body) | ||
66 | .pipe(catchError(err => this.restExtractor.handleError(err))) | ||
67 | } | ||
68 | |||
69 | unbanUser (user: User) { | ||
70 | return this.authHttp.post(UserService.BASE_USERS_URL + user.id + '/unblock', {}) | ||
71 | .pipe(catchError(err => this.restExtractor.handleError(err))) | ||
72 | } | ||
73 | |||
62 | private formatUser (user: User) { | 74 | private formatUser (user: User) { |
63 | let videoQuota | 75 | let videoQuota |
64 | if (user.videoQuota === -1) { | 76 | if (user.videoQuota === -1) { |