aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/follows/following-list/following-list.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin/follows/following-list/following-list.component.ts')
-rw-r--r--client/src/app/+admin/follows/following-list/following-list.component.ts40
1 files changed, 40 insertions, 0 deletions
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts
new file mode 100644
index 000000000..7d2c5084b
--- /dev/null
+++ b/client/src/app/+admin/follows/following-list/following-list.component.ts
@@ -0,0 +1,40 @@
1import { Component, OnInit } from '@angular/core'
2
3import { NotificationsService } from 'angular2-notifications'
4import { SortMeta } from 'primeng/primeng'
5
6import { ConfirmService } from '../../../core'
7import { RestTable, RestPagination } from '../../../shared'
8import { Pod } from '../../../../../../shared'
9import { FollowService } from '../shared'
10
11@Component({
12 selector: 'my-followers-list',
13 templateUrl: './following-list.component.html'
14})
15export class FollowingListComponent extends RestTable {
16 following: Pod[] = []
17 totalRecords = 0
18 rowsPerPage = 10
19 sort: SortMeta = { field: 'createdAt', order: 1 }
20 pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
21
22 constructor (
23 private notificationsService: NotificationsService,
24 private followService: FollowService
25 ) {
26 super()
27 }
28
29 protected loadData () {
30 this.followService.getFollowing(this.pagination, this.sort)
31 .subscribe(
32 resultList => {
33 this.following = resultList.data
34 this.totalRecords = resultList.total
35 },
36
37 err => this.notificationsService.error('Error', err.message)
38 )
39 }
40}