1 import { Component, OnInit } from '@angular/core'
2 import { Account } from '@app/shared/account/account.model'
3 import { NotificationsService } from 'angular2-notifications'
4 import { SortMeta } from 'primeng/components/common/sortmeta'
5 import { VideoAbuse } from '../../../../../../shared'
7 import { RestPagination, RestTable, VideoAbuseService } from '../../../shared'
10 selector: 'my-video-abuse-list',
11 templateUrl: './video-abuse-list.component.html',
12 styleUrls: [ './video-abuse-list.component.scss']
14 export class VideoAbuseListComponent extends RestTable implements OnInit {
15 videoAbuses: VideoAbuse[] = []
18 sort: SortMeta = { field: 'createdAt', order: 1 }
19 pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
22 private notificationsService: NotificationsService,
23 private videoAbuseService: VideoAbuseService
32 createByString (account: Account) {
33 return Account.CREATE_BY_STRING(account.name, account.host)
36 protected loadData () {
37 return this.videoAbuseService.getVideoAbuses(this.pagination, this.sort)
40 this.videoAbuses = resultList.data
41 this.totalRecords = resultList.total
44 err => this.notificationsService.error('Error', err.message)