diff --git a/src/components/SearchPlayer.tsx b/src/components/SearchPlayer.tsx index 5adc531..2f634b2 100644 --- a/src/components/SearchPlayer.tsx +++ b/src/components/SearchPlayer.tsx @@ -34,7 +34,7 @@ export default function SearchPlayer() { } // Search by name - const players = await searchByName(encodeURIComponent(search)); + const players = await searchByName(search); if (players == undefined) return; setPlayers(players); diff --git a/src/utils/scoresaber/api.ts b/src/utils/scoresaber/api.ts index e6330d7..8b38ea1 100644 --- a/src/utils/scoresaber/api.ts +++ b/src/utils/scoresaber/api.ts @@ -29,7 +29,7 @@ export async function searchByName( name: string, ): Promise { const response = await fetchQueue.fetch( - formatString(SEARCH_PLAYER_URL, name), + encodeURIComponent(formatString(SEARCH_PLAYER_URL, name)), ); const json = await response.json(); @@ -95,7 +95,9 @@ export async function fetchScores( limit = 100; } const response = await fetchQueue.fetch( - formatString(PLAYER_SCORES, playerId, limit, searchType, page), + encodeURIComponent( + formatString(PLAYER_SCORES, playerId, limit, searchType, page), + ), ); const json = await response.json();