Skip to content

Commit 00ddc09

Browse files
committed
if no tags selected, send empty array
1 parent ab16105 commit 00ddc09

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

frontend/src/views/app/Search.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ export default {
115115
this.filters[name] = filters;
116116
},
117117
async search() {
118+
const searchRequest = await this.$http.post('/search', {
119+
min_age: this.filters.age.min,
120+
max_age: this.filters.age.max,
121+
min_score: this.filters.popularity.min,
122+
max_score: this.filters.popularity.max,
123+
max_distance: this.filters.distance.max,
124+
tags: this.filters.interests,
125+
});
118126
if (this.filters.interests.length === 0) {
119127
this.filters.interests = [
120128
'swimming', 'wine', 'reading', 'foodie', 'netflix', 'music', 'yoga', 'golf',
@@ -128,14 +136,6 @@ export default {
128136
'astrology', 'board games', 'craft beer', 'coffee', 'writer',
129137
];
130138
}
131-
const searchRequest = await this.$http.post('/search', {
132-
min_age: this.filters.age.min,
133-
max_age: this.filters.age.max,
134-
min_score: this.filters.popularity.min,
135-
max_score: this.filters.popularity.max,
136-
max_distance: this.filters.distance.max,
137-
tags: this.filters.interests,
138-
});
139139
this.recommendations = searchRequest.data.search_results;
140140
this.recommendations.sort((a, b) => a.distance - b.distance);
141141
for (let i = 0; i < this.recommendations.length; i += 1) {

0 commit comments

Comments
 (0)