]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+admin/follows/following-list/following-list.component.ts
Move activitypub functions from helpers/ to lib/
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / follows / following-list / following-list.component.ts
CommitLineData
60862425 1import { Component } from '@angular/core'
51548b31
C
2import { NotificationsService } from 'angular2-notifications'
3import { SortMeta } from 'primeng/primeng'
60862425
C
4import { AccountFollow } from '../../../../../../shared/models/accounts/follow.model'
5import { RestPagination, RestTable } from '../../../shared'
51548b31
C
6import { FollowService } from '../shared'
7
8@Component({
9 selector: 'my-followers-list',
10 templateUrl: './following-list.component.html'
11})
12export class FollowingListComponent extends RestTable {
60862425 13 following: AccountFollow[] = []
51548b31
C
14 totalRecords = 0
15 rowsPerPage = 10
16 sort: SortMeta = { field: 'createdAt', order: 1 }
17 pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
18
19 constructor (
20 private notificationsService: NotificationsService,
21 private followService: FollowService
22 ) {
23 super()
24 }
25
26 protected loadData () {
27 this.followService.getFollowing(this.pagination, this.sort)
28 .subscribe(
29 resultList => {
30 this.following = resultList.data
31 this.totalRecords = resultList.total
32 },
33
34 err => this.notificationsService.error('Error', err.message)
35 )
36 }
37}