Skip to content

Commit

Permalink
feat: Ability to search by query string
Browse files Browse the repository at this point in the history
  • Loading branch information
itssimple committed Dec 3, 2023
1 parent 67fe423 commit fc0a625
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CFLookup/Pages/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public IndexModel(ILogger<IndexModel> logger, ApiClient cfApiClient, ConnectionM
_redis = connectionMultiplexer.GetDatabase(5);
}

public async Task OnGet(int? projectId = null, int? fileId = null, bool? rcf = false)
public async Task OnGet(int? projectId = null, int? fileId = null, bool? rcf = false, string search = null)

Check warning on line 40 in CFLookup/Pages/Index.cshtml.cs

View workflow job for this annotation

GitHub Actions / generate

Cannot convert null literal to non-nullable reference type.
{
if (fileId.HasValue)
{
Expand All @@ -51,6 +51,12 @@ public async Task OnGet(int? projectId = null, int? fileId = null, bool? rcf = f
FoundMod = await SharedMethods.SearchModAsync(_redis, _cfApiClient, projectId.Value);
}

if (!string.IsNullOrWhiteSpace(search))
{
ProjectSearchField = search;
await OnPostAsync();
}

IsDiscord = false; //Request.Headers.UserAgent.Any(ua => ua.Contains("Discordbot"));

if (rcf.HasValue && rcf.Value)
Expand Down

0 comments on commit fc0a625

Please sign in to comment.