diff options
Diffstat (limited to 'client/src/app/+admin/overview/users/user-list/user-list.component.ts')
-rw-r--r-- | client/src/app/+admin/overview/users/user-list/user-list.component.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/client/src/app/+admin/overview/users/user-list/user-list.component.ts b/client/src/app/+admin/overview/users/user-list/user-list.component.ts index 9fba11cbd..9a9d0f5c6 100644 --- a/client/src/app/+admin/overview/users/user-list/user-list.component.ts +++ b/client/src/app/+admin/overview/users/user-list/user-list.component.ts | |||
@@ -1,10 +1,11 @@ | |||
1 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
2 | import { Component, OnInit, ViewChild } from '@angular/core' | 2 | import { Component, OnInit, ViewChild } from '@angular/core' |
3 | import { ActivatedRoute, Router } from '@angular/router' | 3 | import { ActivatedRoute, Router } from '@angular/router' |
4 | import { AuthService, ConfirmService, Notifier, RestPagination, RestTable, ServerService, UserService } from '@app/core' | 4 | import { AuthService, ConfirmService, Notifier, RestPagination, RestTable, ServerService } from '@app/core' |
5 | import { AdvancedInputFilter } from '@app/shared/shared-forms' | 5 | import { AdvancedInputFilter } from '@app/shared/shared-forms' |
6 | import { DropdownAction } from '@app/shared/shared-main' | 6 | import { DropdownAction } from '@app/shared/shared-main' |
7 | import { UserBanModalComponent } from '@app/shared/shared-moderation' | 7 | import { UserBanModalComponent } from '@app/shared/shared-moderation' |
8 | import { UserAdminService } from '@app/shared/shared-users' | ||
8 | import { User, UserRole } from '@shared/models' | 9 | import { User, UserRole } from '@shared/models' |
9 | 10 | ||
10 | type UserForList = User & { | 11 | type UserForList = User & { |
@@ -57,7 +58,7 @@ export class UserListComponent extends RestTable implements OnInit { | |||
57 | private confirmService: ConfirmService, | 58 | private confirmService: ConfirmService, |
58 | private serverService: ServerService, | 59 | private serverService: ServerService, |
59 | private auth: AuthService, | 60 | private auth: AuthService, |
60 | private userService: UserService | 61 | private userAdminService: UserAdminService |
61 | ) { | 62 | ) { |
62 | super() | 63 | super() |
63 | } | 64 | } |
@@ -177,7 +178,7 @@ export class UserListComponent extends RestTable implements OnInit { | |||
177 | const res = await this.confirmService.confirm($localize`Do you really want to unban ${users.length} users?`, $localize`Unban`) | 178 | const res = await this.confirmService.confirm($localize`Do you really want to unban ${users.length} users?`, $localize`Unban`) |
178 | if (res === false) return | 179 | if (res === false) return |
179 | 180 | ||
180 | this.userService.unbanUsers(users) | 181 | this.userAdminService.unbanUsers(users) |
181 | .subscribe({ | 182 | .subscribe({ |
182 | next: () => { | 183 | next: () => { |
183 | this.notifier.success($localize`${users.length} users unbanned.`) | 184 | this.notifier.success($localize`${users.length} users unbanned.`) |
@@ -200,7 +201,7 @@ export class UserListComponent extends RestTable implements OnInit { | |||
200 | const res = await this.confirmService.confirm(message, $localize`Delete`) | 201 | const res = await this.confirmService.confirm(message, $localize`Delete`) |
201 | if (res === false) return | 202 | if (res === false) return |
202 | 203 | ||
203 | this.userService.removeUser(users) | 204 | this.userAdminService.removeUser(users) |
204 | .subscribe({ | 205 | .subscribe({ |
205 | next: () => { | 206 | next: () => { |
206 | this.notifier.success($localize`${users.length} users deleted.`) | 207 | this.notifier.success($localize`${users.length} users deleted.`) |
@@ -212,7 +213,7 @@ export class UserListComponent extends RestTable implements OnInit { | |||
212 | } | 213 | } |
213 | 214 | ||
214 | setEmailsAsVerified (users: User[]) { | 215 | setEmailsAsVerified (users: User[]) { |
215 | this.userService.updateUsers(users, { emailVerified: true }) | 216 | this.userAdminService.updateUsers(users, { emailVerified: true }) |
216 | .subscribe({ | 217 | .subscribe({ |
217 | next: () => { | 218 | next: () => { |
218 | this.notifier.success($localize`${users.length} users email set as verified.`) | 219 | this.notifier.success($localize`${users.length} users email set as verified.`) |
@@ -230,7 +231,7 @@ export class UserListComponent extends RestTable implements OnInit { | |||
230 | protected reloadData () { | 231 | protected reloadData () { |
231 | this.selectedUsers = [] | 232 | this.selectedUsers = [] |
232 | 233 | ||
233 | this.userService.getUsers({ | 234 | this.userAdminService.getUsers({ |
234 | pagination: this.pagination, | 235 | pagination: this.pagination, |
235 | sort: this.sort, | 236 | sort: this.sort, |
236 | search: this.search | 237 | search: this.search |