diff options
author | Chocobozzz <me@florianbigard.com> | 2018-10-05 16:56:14 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-10-05 17:02:10 +0200 |
commit | 79bd2632d62f2f600d663815fcc00a01ca981aa1 (patch) | |
tree | 2a6b5df65fdd6025dda16cf7cd743c4530c63bf6 /client/src/app/shared/users | |
parent | e724fa93c71d76d709e819a05e5e2904a3c4205b (diff) | |
download | PeerTube-79bd2632d62f2f600d663815fcc00a01ca981aa1.tar.gz PeerTube-79bd2632d62f2f600d663815fcc00a01ca981aa1.tar.zst PeerTube-79bd2632d62f2f600d663815fcc00a01ca981aa1.zip |
Add user moderation in the account page
Diffstat (limited to 'client/src/app/shared/users')
-rw-r--r-- | client/src/app/shared/users/user.service.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts index 5ab290a59..d9b81c181 100644 --- a/client/src/app/shared/users/user.service.ts +++ b/client/src/app/shared/users/user.service.ts | |||
@@ -170,19 +170,19 @@ export class UserService { | |||
170 | ) | 170 | ) |
171 | } | 171 | } |
172 | 172 | ||
173 | removeUser (user: User) { | 173 | removeUser (user: { id: number }) { |
174 | return this.authHttp.delete(UserService.BASE_USERS_URL + user.id) | 174 | return this.authHttp.delete(UserService.BASE_USERS_URL + user.id) |
175 | .pipe(catchError(err => this.restExtractor.handleError(err))) | 175 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
176 | } | 176 | } |
177 | 177 | ||
178 | banUser (user: User, reason?: string) { | 178 | banUser (user: { id: number }, reason?: string) { |
179 | const body = reason ? { reason } : {} | 179 | const body = reason ? { reason } : {} |
180 | 180 | ||
181 | return this.authHttp.post(UserService.BASE_USERS_URL + user.id + '/block', body) | 181 | return this.authHttp.post(UserService.BASE_USERS_URL + user.id + '/block', body) |
182 | .pipe(catchError(err => this.restExtractor.handleError(err))) | 182 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
183 | } | 183 | } |
184 | 184 | ||
185 | unbanUser (user: User) { | 185 | unbanUser (user: { id: number }) { |
186 | return this.authHttp.post(UserService.BASE_USERS_URL + user.id + '/unblock', {}) | 186 | return this.authHttp.post(UserService.BASE_USERS_URL + user.id + '/unblock', {}) |
187 | .pipe(catchError(err => this.restExtractor.handleError(err))) | 187 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
188 | } | 188 | } |