aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/follows/followers-list/followers-list.component.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-15 10:10:41 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:51 +0100
commit51548b31815c6f96f314ae96588a9adca150519d (patch)
treeb3298447b7ac128823016fdec92d083e07d9432e /client/src/app/+admin/follows/followers-list/followers-list.component.ts
parent350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad (diff)
downloadPeerTube-51548b31815c6f96f314ae96588a9adca150519d.tar.gz
PeerTube-51548b31815c6f96f314ae96588a9adca150519d.tar.zst
PeerTube-51548b31815c6f96f314ae96588a9adca150519d.zip
Add follow tabs
Following Follow Followers
Diffstat (limited to 'client/src/app/+admin/follows/followers-list/followers-list.component.ts')
-rw-r--r--client/src/app/+admin/follows/followers-list/followers-list.component.ts41
1 files changed, 41 insertions, 0 deletions
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.ts b/client/src/app/+admin/follows/followers-list/followers-list.component.ts
new file mode 100644
index 000000000..208a0c648
--- /dev/null
+++ b/client/src/app/+admin/follows/followers-list/followers-list.component.ts
@@ -0,0 +1,41 @@
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: './followers-list.component.html',
14 styleUrls: [ './followers-list.component.scss' ]
15})
16export class FollowersListComponent extends RestTable {
17 followers: Pod[] = []
18 totalRecords = 0
19 rowsPerPage = 10
20 sort: SortMeta = { field: 'createdAt', order: 1 }
21 pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
22
23 constructor (
24 private notificationsService: NotificationsService,
25 private followService: FollowService
26 ) {
27 super()
28 }
29
30 protected loadData () {
31 this.followService.getFollowers(this.pagination, this.sort)
32 .subscribe(
33 resultList => {
34 this.followers = resultList.data
35 this.totalRecords = resultList.total
36 },
37
38 err => this.notificationsService.error('Error', err.message)
39 )
40 }
41}