]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+admin/follows/followers-list/followers-list.component.ts
Add ability to manually approves instance followers in REST API
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / follows / followers-list / followers-list.component.ts
CommitLineData
ab998f7b 1import { Component, OnInit } from '@angular/core'
51548b31 2
f8b2c1b4 3import { Notifier } from '@app/core'
51548b31 4import { SortMeta } from 'primeng/primeng'
c48e82b5 5import { ActorFollow } from '../../../../../../shared/models/actors/follow.model'
60862425 6import { RestPagination, RestTable } from '../../../shared'
51548b31 7import { FollowService } from '../shared'
b1d40cff 8import { I18n } from '@ngx-translate/i18n-polyfill'
51548b31
C
9
10@Component({
11 selector: 'my-followers-list',
12 templateUrl: './followers-list.component.html',
13 styleUrls: [ './followers-list.component.scss' ]
14})
ab998f7b 15export class FollowersListComponent extends RestTable implements OnInit {
c48e82b5 16 followers: ActorFollow[] = []
51548b31
C
17 totalRecords = 0
18 rowsPerPage = 10
19 sort: SortMeta = { field: 'createdAt', order: 1 }
20 pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
21
22 constructor (
f8b2c1b4 23 private notifier: Notifier,
b1d40cff
C
24 private followService: FollowService,
25 private i18n: I18n
51548b31
C
26 ) {
27 super()
28 }
29
ab998f7b 30 ngOnInit () {
24b9417c 31 this.initialize()
ab998f7b
C
32 }
33
51548b31 34 protected loadData () {
16c07398 35 this.followService.getFollowers(this.pagination, this.sort, this.search)
51548b31
C
36 .subscribe(
37 resultList => {
38 this.followers = resultList.data
39 this.totalRecords = resultList.total
40 },
41
f8b2c1b4 42 err => this.notifier.error(err.message)
51548b31
C
43 )
44 }
45}