Skip to content

Commit

Permalink
1342: use URLSearchParams
Browse files Browse the repository at this point in the history
  • Loading branch information
sinejespersen committed May 29, 2024
1 parent 2b9db2c commit c78354b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/slide/content/station/station-selector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@ function StationSelector({
};

useEffect(() => {
const baseUrl = "https://www.rejseplanen.dk/api/location.name";
fetch(
`https://www.rejseplanen.dk/api/location.name?accessId=${
config.rejseplanenApiKey || ""
}&format=json&input=${searchText}`
`${baseUrl}?${new URLSearchParams({
accessId: config.rejseplanenApiKey || "",
format: "json",
input: searchText,
})}`
)
.then((response) => response.json())
.then((rpData) => {
Expand Down

0 comments on commit c78354b

Please sign in to comment.