Skip to content

Commit

Permalink
Encode query in search
Browse files Browse the repository at this point in the history
  • Loading branch information
petrvecera committed Aug 7, 2024
1 parent 499a7ca commit 4746d56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pages/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ export const getServerSideProps: GetServerSideProps = async ({ query }) => {

if (q) {
try {
const res = await fetch(`${config.BASE_CLOUD_FUNCTIONS_URL}/searchPlayers2Http?alias=${q}`);
const res = await fetch(
`${config.BASE_CLOUD_FUNCTIONS_URL}/searchPlayers2Http?alias=${encodeURIComponent(q as string)}`,
);

if (res.status !== 200) {
data = await res.json();
Expand Down

0 comments on commit 4746d56

Please sign in to comment.