paperless-ngx/src-ui/src/app/components/dashboard/dashboard.component.ts

26 lines
682 B
TypeScript
Raw Normal View History

2020-10-27 01:10:18 +01:00
import { Component, OnInit } from '@angular/core';
import { PaperlessSavedView } from 'src/app/data/paperless-saved-view';
import { SavedViewService } from 'src/app/services/rest/saved-view.service';
2020-10-31 00:56:20 +01:00
2020-10-27 01:10:18 +01:00
@Component({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.scss']
2020-10-27 01:10:18 +01:00
})
export class DashboardComponent implements OnInit {
2020-11-22 22:35:39 +01:00
constructor(
2020-12-14 20:59:18 +01:00
private savedViewService: SavedViewService) { }
savedViews: PaperlessSavedView[] = []
2020-10-27 01:10:18 +01:00
ngOnInit(): void {
this.savedViewService.listAll().subscribe(results => {
this.savedViews = results.results.filter(savedView => savedView.show_on_dashboard)
})
2020-10-31 00:56:20 +01:00
}
2020-10-27 01:10:18 +01:00
}