Skip to content
Snippets Groups Projects
Commit 0d3a9a29 authored by schneider210's avatar schneider210
Browse files

fix: logic to display any items on empty search

parent 638383ac
No related branches found
No related tags found
1 merge request!60loading indicator for search
Pipeline #219822 passed
......@@ -11,7 +11,6 @@
class="loading-wrapper py-10"
>
<v-progress-circular
v-if="loading"
color="primary"
size="50"
indeterminate
......@@ -78,12 +77,16 @@ export default {
onSearchInput(query) {
this.query = query;
this.page = 1;
this.search(this.query, 0, this.size)
},
async search(value, from, size) {
this.loading = false;
try {
this.items = [];
this.total = 0;
this.loading = true;
const searchResponse = await apiService.search(value, from, size);
const items = searchResponse.hits?.hits;
......@@ -92,9 +95,10 @@ export default {
this.items = items.map(x => ({ ...x, searchTerm: value }));
}
} catch(error) {
// console.log(error.message);
this.items = [];
this.total = 0;
} finally {
this.loading = true;
this.loading = false;
}
},
scrollUp() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment