From 0476b685850d70762c2a3d3f14a9d379c91dcd2f Mon Sep 17 00:00:00 2001 From: mikiher Date: Sun, 21 Jul 2024 14:00:55 +0300 Subject: [PATCH] fix: Encode search query parameter in search.vue --- client/pages/library/_library/search.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/pages/library/_library/search.vue b/client/pages/library/_library/search.vue index 2f43d202..653fc3de 100644 --- a/client/pages/library/_library/search.vue +++ b/client/pages/library/_library/search.vue @@ -16,7 +16,7 @@ export default { if (!library) { return redirect('/oops?message=Library not found') } - let results = await app.$axios.$get(`/api/libraries/${libraryId}/search?q=${query.q}`).catch((error) => { + let results = await app.$axios.$get(`/api/libraries/${libraryId}/search?q=${encodeURIComponent(query.q)}`).catch((error) => { console.error('Failed to search library', error) return null }) @@ -55,7 +55,7 @@ export default { }, methods: { async search() { - const results = await this.$axios.$get(`/api/libraries/${this.libraryId}/search?q=${this.query}`).catch((error) => { + const results = await this.$axios.$get(`/api/libraries/${this.libraryId}/search?q=${encodeURIComponent(this.query)}`).catch((error) => { console.error('Failed to search library', error) return null })