Explorar o código

fix: encode artist in albums query

Fela Maslen %!s(int64=5) %!d(string=hai) anos
pai
achega
860171f87a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      gmus/src/hooks/fetch/artists.ts

+ 1 - 1
gmus/src/hooks/fetch/artists.ts

@@ -25,7 +25,7 @@ const sendAlbumsRequest = (
   axios: AxiosInstance,
   query: AlbumsQuery,
 ): Promise<AxiosResponse<AlbumsResponse>> =>
-  axios.get(`${getApiUrl()}/albums?artist=${query.artist}`);
+  axios.get(`${getApiUrl()}/albums?artist=${encodeURIComponent(query.artist)}`);
 
 type SongsResponse = {
   artist: string;