- constructor (
- private notificationsService: NotificationsService,
- private blocklistService: BlocklistService,
- private i18n: I18n
- ) {
- super()
- }
-
- ngOnInit () {
- this.initialize()
- }
-
- unblockServer (serverBlock: ServerBlock) {
- const host = serverBlock.blockedServer.host
-
- this.blocklistService.unblockServerByUser(host)
- .subscribe(
- () => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Instance {{host}} unmuted.', { host })
- )
-
- this.loadData()
- }
- )
- }
-
- protected loadData () {
- return this.blocklistService.getUserServerBlocklist(this.pagination, this.sort)
- .subscribe(
- resultList => {
- this.blockedAccounts = resultList.data
- this.totalRecords = resultList.total
- },
-
- err => this.notificationsService.error(this.i18n('Error'), err.message)
- )