Skip to content

Commit

Permalink
Searchbar result fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoumpierre committed Mar 28, 2018
1 parent f4e6bf5 commit 7789658
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/pages/orders/form/order-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ export class OrderFormPage {
this.order = [];

if (id && id.trim() != '') {
event.component.items = this.customers.filter(item => {
return item.name.toLowerCase().indexOf(id) !== -1 || item.id.toString().indexOf(id) !== -1;
});
event.component.items = this.customers.filter(item => item.name.toLowerCase().indexOf(id.toLowerCase()) !== -1 || item.id.toString().indexOf(id) !== -1);

event.component.isSearching = false;
}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/orders/modal/order-product-modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ export class OrderProductModalPage {

event.component.isSearching = true;

this.apiProvider.builder('products').get({id: id}).subscribe((products) => {
event.component.items = products;
if (id && id.trim() != '') {
event.component.items = this.products.filter(item => item.name.toLowerCase().indexOf(id.toLowerCase()) !== -1 || item.id.toString().indexOf(id) !== -1);

event.component.isSearching = false;
});
}
}

/**
Expand Down

0 comments on commit 7789658

Please sign in to comment.