- async removeUser (user: User) {
- if (user.username === 'root') {
- this.notificationsService.error(this.i18n('Error'), this.i18n('You cannot delete root.'))
- return
+ onUserChanged () {
+ this.loadData()
+ }
+
+ async unbanUsers (users: User[]) {
+ const message = this.i18n('Do you really want to unban {{num}} users?', { num: users.length })
+
+ const res = await this.confirmService.confirm(message, this.i18n('Unban'))
+ if (res === false) return
+
+ this.userService.unbanUsers(users)
+ .subscribe(
+ () => {
+ const message = this.i18n('{{num}} users unbanned.', { num: users.length })
+
+ this.notifier.success(message)
+ this.loadData()
+ },
+
+ err => this.notifier.error(err.message)
+ )
+ }
+
+ async removeUsers (users: User[]) {
+ for (const user of users) {
+ if (user.username === 'root') {
+ this.notifier.error(this.i18n('You cannot delete root.'))
+ return
+ }