]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/users/user-list/user-list.component.ts
Merge branch 'master' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / users / user-list / user-list.component.ts
index f3e7e0ead8aad4998d988ebce38810f8a484ede3..3859af9ffcb5900490b67fdce2c2c2657b9f21b1 100644 (file)
@@ -23,7 +23,7 @@ export class UserListComponent extends RestTable implements OnInit {
   pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
 
   selectedUsers: User[] = []
-  bulkUserActions: DropdownAction<User>[] = []
+  bulkUserActions: DropdownAction<User[]>[] = []
 
   constructor (
     private notificationsService: NotificationsService,
@@ -35,7 +35,7 @@ export class UserListComponent extends RestTable implements OnInit {
   }
 
   ngOnInit () {
-    this.loadSort()
+    this.initialize()
 
     this.bulkUserActions = [
       {
@@ -55,20 +55,6 @@ export class UserListComponent extends RestTable implements OnInit {
     ]
   }
 
-  protected loadData () {
-    this.selectedUsers = []
-
-    this.userService.getUsers(this.pagination, this.sort)
-                    .subscribe(
-                      resultList => {
-                        this.users = resultList.data
-                        this.totalRecords = resultList.total
-                      },
-
-                      err => this.notificationsService.error(this.i18n('Error'), err.message)
-                    )
-  }
-
   openBanUserModal (users: User[]) {
     for (const user of users) {
       if (user.username === 'root') {
@@ -131,4 +117,18 @@ export class UserListComponent extends RestTable implements OnInit {
   isInSelectionMode () {
     return this.selectedUsers.length !== 0
   }
+
+  protected loadData () {
+    this.selectedUsers = []
+
+    this.userService.getUsers(this.pagination, this.sort, this.search)
+                    .subscribe(
+                      resultList => {
+                        this.users = resultList.data
+                        this.totalRecords = resultList.total
+                      },
+
+                      err => this.notificationsService.error(this.i18n('Error'), err.message)
+                    )
+  }
 }