Fix search filter in video reports
authorChocobozzz <me@florianbigard.com>
Fri, 26 Jun 2020 13:41:35 +0000 (15:41 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 26 Jun 2020 13:41:35 +0000 (15:41 +0200)
client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts

index b0a655e714d154f53a03b497ab8215cdddb54738..409dd42c7e68285d2294275f905ca73ebceddaf1 100644 (file)
@@ -196,10 +196,10 @@ export class VideoAbuseListComponent extends RestTable implements OnInit, AfterV
     this.initialize()
 
     this.route.queryParams
-      .pipe(filter(params => params.search !== undefined && params.search !== null))
       .subscribe(params => {
-        this.search = params.search
-        this.setTableFilter(params.search)
+        this.search = params.search || ''
+
+        this.setTableFilter(this.search)
         this.loadData()
       })
   }
@@ -229,6 +229,7 @@ export class VideoAbuseListComponent extends RestTable implements OnInit, AfterV
   setQueryParams (search: string) {
     const queryParams: Params = {}
     if (search) Object.assign(queryParams, { search })
+
     this.router.navigate([ '/admin/moderation/video-abuses/list' ], { queryParams })
   }