1 import { Component, OnInit } from '@angular/core'
3 import { NotificationsService } from 'angular2-notifications'
4 import { SortMeta } from 'primeng/primeng'
6 import { RestTable, RestPagination, VideoAbuseService } from '../../../shared'
7 import { VideoAbuse } from '../../../../../../shared'
10 selector: 'my-video-abuse-list',
11 templateUrl: './video-abuse-list.component.html'
13 export class VideoAbuseListComponent extends RestTable implements OnInit {
14 videoAbuses: VideoAbuse[] = []
17 sort: SortMeta = { field: 'id', order: 1 }
18 pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
21 private notificationsService: NotificationsService,
22 private videoAbuseService: VideoAbuseService
31 getRouterVideoLink (videoId: number) {
32 return [ '/videos', videoId ]
35 protected loadData () {
36 return this.videoAbuseService.getVideoAbuses(this.pagination, this.sort)
39 this.videoAbuses = resultList.data
40 this.totalRecords = resultList.total
43 err => this.notificationsService.error('Error', err)