Skip to content

Commit 279dc6f

Browse files
Fixed call error when filter item is applied
1 parent 634d420 commit 279dc6f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Web/WebSPA/Client/modules/catalog/catalog.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ export class CatalogComponent implements OnInit {
5656

5757
onFilterApplied(event: any) {
5858
event.preventDefault();
59+
60+
this.brandSelected = this.brandSelected && this.brandSelected.toString() != "null" ? this.brandSelected : null;
61+
this.typeSelected = this.typeSelected && this.typeSelected.toString() != "null" ? this.typeSelected : null;
5962
this.getCatalog(this.paginationInfo.itemsPage, this.paginationInfo.actualPage, this.brandSelected, this.typeSelected);
6063
}
6164

@@ -82,6 +85,7 @@ export class CatalogComponent implements OnInit {
8285

8386
getCatalog(pageSize: number, pageIndex: number, brand?: number, type?: number) {
8487
this.errorReceived = false;
88+
8589
this.service.getCatalog(pageIndex, pageSize, brand, type)
8690
.pipe(catchError((err) => this.handleError(err)))
8791
.subscribe(catalog => {

0 commit comments

Comments
 (0)