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

refactor: fixing console errors.

parent d09ad535
Branches
Tags
1 merge request!98feat/#124: returning from tido to the respective search hit list page
Pipeline #226666 passed
...@@ -45,10 +45,7 @@ ...@@ -45,10 +45,7 @@
:page="page" :page="page"
/> />
<div <div class="text-center">
class="text-center"
@click="scrollUp()"
>
<v-pagination <v-pagination
v-if="distinctSheets > size" v-if="distinctSheets > size"
v-model="page" v-model="page"
...@@ -83,7 +80,6 @@ export default { ...@@ -83,7 +80,6 @@ export default {
total: 0, total: 0,
showPlaceholder: false, showPlaceholder: false,
showNoResult: false, showNoResult: false,
page: 1,
}; };
}, },
watch:{ watch:{
...@@ -91,7 +87,7 @@ export default { ...@@ -91,7 +87,7 @@ export default {
this.loading = true; this.loading = true;
const from = this.size * (page - 1); const from = this.size * (page - 1);
this.$router.push({ query: { ...this.$route.query, searchTerm:this.query.trim(),page } }); this.handleNavigation(this.query.trim(),page||1);
this.search(this.query.trim(), from, this.size); this.search(this.query.trim(), from, this.size);
}, },
}, },
...@@ -124,7 +120,7 @@ export default { ...@@ -124,7 +120,7 @@ export default {
}, },
}, },
methods: { methods: {
onSearchInput(query,page) { onSearchInput(query, page) {
this.query = query; this.query = query;
this.resetList(); this.resetList();
...@@ -132,10 +128,15 @@ export default { ...@@ -132,10 +128,15 @@ export default {
this.showNoResult = false; this.showNoResult = false;
this.search(this.query.trim(), 0, this.size); this.search(this.query.trim(), 0, this.size);
this.handleNavigation(query,page||1);
if (this.$route.query.searchTerm !== query) { this.page = page || 1;
this.$router.push({ query: { ...this.$route.query, searchTerm:query,page:page || this.page } }); },
handleNavigation(query, page) {
if(this.$route.query.searchTerm === query && this.$route.query.page === String(page)) {
return;
} }
this.$router.push({ query: { ...this.$route.query, searchTerm:query, page:page || 1 } });
}, },
async search(value, from, size) { async search(value, from, size) {
this.hitCounter = from + 1; this.hitCounter = from + 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment