Sfoglia il codice sorgente

fix: encode artist in albums query

Fela Maslen 5 anni fa
parent
commit
860171f87a
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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;