From 279dc6f1c0bf5e6383dde7fa7c100b3cfe081bbb Mon Sep 17 00:00:00 2001 From: Carlos de Miguel Ferrero Date: Tue, 15 Dec 2020 17:18:55 +0100 Subject: [PATCH] Fixed call error when filter item is applied --- src/Web/WebSPA/Client/modules/catalog/catalog.component.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Web/WebSPA/Client/modules/catalog/catalog.component.ts b/src/Web/WebSPA/Client/modules/catalog/catalog.component.ts index 9c578699d..18b30d4b7 100644 --- a/src/Web/WebSPA/Client/modules/catalog/catalog.component.ts +++ b/src/Web/WebSPA/Client/modules/catalog/catalog.component.ts @@ -56,6 +56,9 @@ export class CatalogComponent implements OnInit { onFilterApplied(event: any) { event.preventDefault(); + + this.brandSelected = this.brandSelected && this.brandSelected.toString() != "null" ? this.brandSelected : null; + this.typeSelected = this.typeSelected && this.typeSelected.toString() != "null" ? this.typeSelected : null; this.getCatalog(this.paginationInfo.itemsPage, this.paginationInfo.actualPage, this.brandSelected, this.typeSelected); } @@ -82,6 +85,7 @@ export class CatalogComponent implements OnInit { getCatalog(pageSize: number, pageIndex: number, brand?: number, type?: number) { this.errorReceived = false; + this.service.getCatalog(pageIndex, pageSize, brand, type) .pipe(catchError((err) => this.handleError(err))) .subscribe(catalog => {