diff --git a/frontend/src/app/containers/search/search.component.ts b/frontend/src/app/containers/search/search.component.ts index 27d1481..57014a3 100644 --- a/frontend/src/app/containers/search/search.component.ts +++ b/frontend/src/app/containers/search/search.component.ts @@ -61,12 +61,16 @@ export class SearchComponent implements OnInit { {name: 'Price', property: 'average_per_day_costs'} ]; + this.sortBy = 'score'; + this.sortDes = true; + if (this.results.length > 0) { - this.results[0].scores.forEach(({type}) => { + const tags = await this.ss.getAvailableTags(); + for (const {type} of this.results[0].scores) { if (!this.sortOptions.find(i => i.property === type)) { - this.sortOptions.push({name: type, property: type, isScore: true}); + this.sortOptions.push({name: type, property: type, isScore: true, descending: tags.includes(type)}); } - }); + } } // Calculate duration