|
|
|
@@ -1,5 +1,5 @@ |
|
|
|
import {AfterViewInit, Component, OnInit, ViewChild} from '@angular/core'; |
|
|
|
import {DocumentJsonld, DocumentService} from "@app/core/api/v1"; |
|
|
|
import {AfterViewInit, Component, Input, OnInit, ViewChild} from '@angular/core'; |
|
|
|
import {DocumentJsonld, DocumentService, PartnerJsonld, ProductJsonld} from "@app/core/api/v1"; |
|
|
|
import {AppHelperService} from "@app/_helpers/app-helper.service"; |
|
|
|
import {MatSort, Sort} from "@angular/material/sort"; |
|
|
|
import {Subscription} from "rxjs"; |
|
|
|
@@ -15,6 +15,8 @@ import {NewDocumentComponent} from "@app/_views/documents/new-document/new-docum |
|
|
|
}) |
|
|
|
export class DocumentListComponent implements OnInit, AfterViewInit { |
|
|
|
|
|
|
|
@Input() public product!: ProductJsonld; |
|
|
|
@Input() public partner!: PartnerJsonld; |
|
|
|
@ViewChild(MatSort) sort; |
|
|
|
@ViewChild("pagingComponent", { static: false }) pagingComponent!: PagingComponent; |
|
|
|
|
|
|
|
@@ -49,7 +51,13 @@ export class DocumentListComponent implements OnInit, AfterViewInit { |
|
|
|
getData = () => { |
|
|
|
this.documentsSub = this.documentService.documentsGetCollection( |
|
|
|
this.pagingComponent.getPageIndex(), |
|
|
|
this.pagingComponent.getPageSize() |
|
|
|
this.pagingComponent.getPageSize(), |
|
|
|
undefined, |
|
|
|
undefined, |
|
|
|
this.partner !== undefined ? this.partner.id : undefined, |
|
|
|
undefined, |
|
|
|
this.product !== undefined ? this.product.id : undefined |
|
|
|
|
|
|
|
).subscribe( |
|
|
|
data => { |
|
|
|
this.documents = data["hydra:member"]; |
|
|
|
|