Skip to content

Commit

Permalink
fixes promote search
Browse files Browse the repository at this point in the history
  • Loading branch information
andreromao committed Apr 15, 2024
1 parent 262e24c commit f4d0e3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/user/promote/promote.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h5 *ngIf="info && info.length > 0 && info !== 'team'" class='name center'>
<div class="col-sm-6 promote typeahead">
<mat-form-field appearance="fill" style="width: 100%; background-color: white;">
<mat-label>Search for company</mat-label>
<mat-select name="searchCompany" id="searchCompany" name="searchCompany" [(ngModel)]="searchedCompany">
<mat-select name="searchCompany" id="searchCompany" [(ngModel)]="searchedCompany">
<input (keyup)="onKey($event.target.value)" style="width: 100%;">
<mat-option *ngFor="let comp of selectedCompanies" [value]="comp">
{{ comp.name }}
Expand Down
6 changes: 3 additions & 3 deletions src/app/user/promote/promote.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ export class PromoteComponent implements OnInit {
}

onKey(value) {
this.selectedCompanies = this.search(value.name);
this.selectedCompanies = this.search(value);
}

search(value: Company) {
let filter = value.name.toLowerCase();
search(value: string) {
let filter = value.toLowerCase();
return this.companies.filter(comp => comp.name.toLowerCase().includes(filter));
}
}

0 comments on commit f4d0e3a

Please sign in to comment.