Skip to content
Snippets Groups Projects
Commit d9046f9a authored by Manikanth Dindigala's avatar Manikanth Dindigala
Browse files

refactor: adding some blank spaces.

parent 80207739
No related branches found
No related tags found
1 merge request!98feat/#124: returning from tido to the respective search hit list page
Pipeline #226696 passed
......@@ -87,17 +87,21 @@ export default {
this.loading = true;
const from = this.size * (page - 1);
this.handleNavigation(this.query.trim(),page||1);
this.handleNavigation(this.query.trim(), page || 1);
this.search(this.query.trim(), from, this.size);
},
},
mounted(){
const page = this.$route.query?.page;
if(page){
if(page) {
this.page = parseInt(page);
}
if(this.$route.query?.searchTerm) {
this.onSearchInput(this.$route.query.searchTerm,this.page);
this.onSearchInput(this.$route.query.searchTerm, this.page);
} else {
this.showPlaceholder = true;
}
......@@ -128,9 +132,12 @@ export default {
this.showNoResult = false;
this.search(this.query.trim(), 0, this.size);
this.handleNavigation(query,page||1);
this.handleNavigation(query, page || 1);
this.page = page || 1;
},
handleNavigation(query, page) {
if(this.$route.query.searchTerm === query && this.$route.query.page === String(page)) {
return;
......@@ -138,6 +145,7 @@ export default {
this.$router.push({ query: { ...this.$route.query, searchTerm:query, page:page || 1 } });
},
async search(value, from, size) {
this.hitCounter = from + 1;
......@@ -169,6 +177,7 @@ export default {
this.loading = false;
}
},
resetList() {
this.items = [];
this.distinctSheets = 0;
......
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