From 17d5e93fed92b73be1da1ad5318501ab1b62967f Mon Sep 17 00:00:00 2001 From: Osma Suominen Date: Wed, 18 Dec 2024 16:36:53 +0200 Subject: [PATCH] simplify search page URL construction --- resource/js/vocab-search.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/resource/js/vocab-search.js b/resource/js/vocab-search.js index b39cd9b53..3ab989834 100644 --- a/resource/js/vocab-search.js +++ b/resource/js/vocab-search.js @@ -172,11 +172,9 @@ const vocabSearch = Vue.createApp({ gotoSearchPage () { if (!this.searchTerm) return - const currentVocab = window.SKOSMOS.vocab + '/' + window.SKOSMOS.lang + '/' - const vocabHref = window.location.href.substring(0, window.location.href.lastIndexOf(window.SKOSMOS.vocab)) + currentVocab const searchUrlParams = new URLSearchParams({ clang: window.SKOSMOS.content_lang, q: this.searchTerm }) if (this.selectedLanguage === 'all') searchUrlParams.set('anylang', 'true') - const searchUrl = vocabHref + 'search?' + searchUrlParams.toString() + const searchUrl = window.SKOSMOS.vocab + '/' + window.SKOSMOS.lang + '/search?' + searchUrlParams.toString() window.location.href = searchUrl }, changeLang (clang) {