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 })