Skip to content

Commit

Permalink
fix: modrinth search query replaces whitespace with -
Browse files Browse the repository at this point in the history
  • Loading branch information
olwalkey committed Dec 27, 2024
1 parent ee545c4 commit 7a310d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions resources/scripts/components/server/modrinth/DisplayMods.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ const ProjectSelector: React.FC<Props> = ({ appVersion, baseUrl, nonApiUrl }) =>
index: 'relevance',
offset: `${offset}`,
});

const apiUrl = `${baseUrl}${apiEndpoints.projects}?${searchParams.toString()}&query=${settings.searchTerms}`;
// console.log('Constructed API URL:', apiUrl);
const query = settings.searchTerms.replace(/ /g, '-');
const apiUrl = `${baseUrl}${apiEndpoints.projects}?${searchParams.toString()}&query=${query}`;
console.log('Constructed API URL:', apiUrl);

const response = await fetch(apiUrl, {
headers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ export default () => {
getAppVersion();
}, []);

// console.log(settings.searchTerms);

useEffect(() => {
setSearchTerm('');
}, [location]);
Expand Down

0 comments on commit 7a310d5

Please sign in to comment.