From 51548b31815c6f96f314ae96588a9adca150519d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 15 Nov 2017 10:10:41 +0100 Subject: Add follow tabs Following Follow Followers --- .../followers-list/followers-list.component.ts | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 client/src/app/+admin/follows/followers-list/followers-list.component.ts (limited to 'client/src/app/+admin/follows/followers-list/followers-list.component.ts') 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 @@ +import { Component, OnInit } from '@angular/core' + +import { NotificationsService } from 'angular2-notifications' +import { SortMeta } from 'primeng/primeng' + +import { ConfirmService } from '../../../core' +import { RestTable, RestPagination } from '../../../shared' +import { Pod } from '../../../../../../shared' +import { FollowService } from '../shared' + +@Component({ + selector: 'my-followers-list', + templateUrl: './followers-list.component.html', + styleUrls: [ './followers-list.component.scss' ] +}) +export class FollowersListComponent extends RestTable { + followers: Pod[] = [] + totalRecords = 0 + rowsPerPage = 10 + sort: SortMeta = { field: 'createdAt', order: 1 } + pagination: RestPagination = { count: this.rowsPerPage, start: 0 } + + constructor ( + private notificationsService: NotificationsService, + private followService: FollowService + ) { + super() + } + + protected loadData () { + this.followService.getFollowers(this.pagination, this.sort) + .subscribe( + resultList => { + this.followers = resultList.data + this.totalRecords = resultList.total + }, + + err => this.notificationsService.error('Error', err.message) + ) + } +} -- cgit v1.2.3