import { NotificationsService } from 'angular2-notifications'
import { SortMeta } from 'primeng/primeng'
-import { AccountFollow } from '../../../../../../shared/models/actors/follow.model'
+import { ActorFollow } from '../../../../../../shared/models/actors/follow.model'
import { RestPagination, RestTable } from '../../../shared'
import { FollowService } from '../shared'
+import { I18n } from '@ngx-translate/i18n-polyfill'
@Component({
selector: 'my-followers-list',
styleUrls: [ './followers-list.component.scss' ]
})
export class FollowersListComponent extends RestTable implements OnInit {
- followers: AccountFollow[] = []
+ followers: ActorFollow[] = []
totalRecords = 0
rowsPerPage = 10
sort: SortMeta = { field: 'createdAt', order: 1 }
constructor (
private notificationsService: NotificationsService,
- private followService: FollowService
+ private followService: FollowService,
+ private i18n: I18n
) {
super()
}
ngOnInit () {
- this.loadSort()
+ this.initialize()
}
protected loadData () {
- this.followService.getFollowers(this.pagination, this.sort)
+ this.followService.getFollowers(this.pagination, this.sort, this.search)
.subscribe(
resultList => {
this.followers = resultList.data
this.totalRecords = resultList.total
},
- err => this.notificationsService.error('Error', err.message)
+ err => this.notificationsService.error(this.i18n('Error'), err.message)
)
}
}