Skip to content

Commit 1d92274

Browse files
committed
use "search" in url, fix when query string is missing
1 parent 460f8fb commit 1d92274

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

SporeCommunity.ModBrowser.Blazor/Pages/Index.razor

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,19 @@ else
3939

4040
private GithubModSearchEngine github = new("Spore-Community/ModBrowser");
4141

42-
[SupplyParameterFromQuery]
42+
[SupplyParameterFromQuery(Name = "search")]
4343
private string searchTerm { get; set; } = "";
4444

4545
private List<ModListing> mods = new();
4646

4747
protected override async Task OnInitializedAsync()
4848
{
49+
// If the search term is empty, we want to list all mods
50+
if(string.IsNullOrWhiteSpace(searchTerm))
51+
{
52+
searchTerm = "";
53+
}
54+
4955
await ExecuteSearch();
5056
}
5157

0 commit comments

Comments
 (0)