Add accommodation to permanent sort options
This commit is contained in:
parent
1fb6f607a2
commit
846410e6bf
@ -13,7 +13,7 @@
|
||||
<mat-divider *ngIf="result.total_accommodation_costs"></mat-divider>
|
||||
<div *ngIf="result.total_accommodation_costs" class="total-accommodation">
|
||||
<mat-icon>euro</mat-icon>
|
||||
<span>{{result.total_accommodation_costs|number:'1.2-2'}}€</span>
|
||||
<span matTooltip="Total accommodation">{{result.total_accommodation_costs|number:'1.2-2'}}€</span>
|
||||
</div>
|
||||
<mat-divider *ngIf="result.scores.length > 0"></mat-divider>
|
||||
<div class="searched-params">
|
||||
|
||||
@ -53,12 +53,15 @@ export class SearchComponent implements OnInit {
|
||||
|
||||
this.sortOptions = [
|
||||
{name: 'Relevance', property: 'score', descending: true},
|
||||
{name: 'Name', property: 'name'}
|
||||
{name: 'Name', property: 'name'},
|
||||
{name: 'Accommodation', property: 'accommodation_costs'}
|
||||
];
|
||||
|
||||
if (this.results.length > 0) {
|
||||
this.results[0].scores.forEach(({type}) => {
|
||||
this.sortOptions.push({name: type, property: type, isScore: true});
|
||||
if (!this.sortOptions.find(i => i.property === type)) {
|
||||
this.sortOptions.push({name: type, property: type, isScore: true});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user