Problem: + in query is replace by space

Solution: encode url for search request
This commit is contained in:
Peter Stuifzand 2022-04-16 21:22:17 +02:00
parent 8f16487a30
commit b3f21184c6

View File

@ -265,7 +265,11 @@ export default new Vuex.Store({
if (state.channel !== null && state.channel.uid !== null && state.channel.uid !== 'home') { if (state.channel !== null && state.channel.uid !== null && state.channel.uid !== 'home') {
channel = state.channel.uid channel = state.channel.uid
} }
return fetch(this.state.microsubEndpoint + '?action=search&channel='+channel+'&query='+query, { const url = new URL(this.state.microsubEndpoint)
url.searchParams.set('action', 'search')
url.searchParams.set('channel', channel)
url.searchParams.set('query', query)
return fetch(url.toString(), {
headers: { headers: {
'Authorization': 'Bearer ' + this.state.access_token 'Authorization': 'Bearer ' + this.state.access_token
}, },