Passing logged-in user credentials from twig to vue.

This commit is contained in:
krzysiej
2022-06-21 12:39:22 +02:00
parent 00bb86f798
commit c054f791b1
6 changed files with 38 additions and 11 deletions

View File

@@ -52,6 +52,7 @@ export default {
},
computed: {
...mapState('booksmodule', ['books']),
...mapState('usermodule', ['user']),
},
methods: {
...mapActions('booksmodule', [
@@ -62,7 +63,7 @@ export default {
this.findAll(this.searchTerm);
},
updateHistory: function () {
if (history.pushState) {
if (this.searchTerm && history.pushState) {
let url = window.location.protocol + "//" + window.location.host + window.location.pathname + '?search=' + this.searchTerm;
window.history.pushState({path: url}, '', url);
}