aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/angular/videos/components
diff options
context:
space:
mode:
Diffstat (limited to 'client/angular/videos/components')
-rw-r--r--client/angular/videos/components/list/videos-list.component.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/client/angular/videos/components/list/videos-list.component.ts b/client/angular/videos/components/list/videos-list.component.ts
index 341afdaa6..a17b06cd9 100644
--- a/client/angular/videos/components/list/videos-list.component.ts
+++ b/client/angular/videos/components/list/videos-list.component.ts
@@ -9,6 +9,7 @@ import { User } from '../../../users/models/user';
9import { VideosService } from '../../videos.service'; 9import { VideosService } from '../../videos.service';
10import { Video } from '../../video'; 10import { Video } from '../../video';
11import { VideoMiniatureComponent } from './video-miniature.component'; 11import { VideoMiniatureComponent } from './video-miniature.component';
12import { Search, SearchField } from '../../../app/search';
12 13
13@Component({ 14@Component({
14 selector: 'my-videos-list', 15 selector: 'my-videos-list',
@@ -26,14 +27,17 @@ export class VideosListComponent implements OnInit {
26 total: 0 27 total: 0
27 } 28 }
28 29
29 private search: string; 30 private search: Search;
30 31
31 constructor( 32 constructor(
32 private _authService: AuthService, 33 private _authService: AuthService,
33 private _videosService: VideosService, 34 private _videosService: VideosService,
34 private _routeParams: RouteParams 35 private _routeParams: RouteParams
35 ) { 36 ) {
36 this.search = this._routeParams.get('search'); 37 this.search = {
38 value: this._routeParams.get('search'),
39 field: <SearchField>this._routeParams.get('field')
40 }
37 } 41 }
38 42
39 ngOnInit() { 43 ngOnInit() {
@@ -47,7 +51,7 @@ export class VideosListComponent implements OnInit {
47 getVideos() { 51 getVideos() {
48 let observable = null; 52 let observable = null;
49 53
50 if (this.search !== null) { 54 if (this.search.value !== null) {
51 observable = this._videosService.searchVideos(this.search, this.pagination); 55 observable = this._videosService.searchVideos(this.search, this.pagination);
52 } else { 56 } else {
53 observable = this._videosService.getVideos(this.pagination); 57 observable = this._videosService.getVideos(this.pagination);