add search to package manager components

This commit is contained in:
Shaun Walker
2021-06-23 13:00:44 -04:00
parent c2f7546488
commit bfafffd8cb
10 changed files with 223 additions and 66 deletions

View File

@ -27,8 +27,7 @@ namespace Oqtane.Services
public async Task<List<Package>> GetPackagesAsync(string type, string search)
{
List<Package> packages = await GetJsonAsync<List<Package>>($"{Apiurl}?type={type}&search={WebUtility.UrlEncode(search)}");
return packages.OrderByDescending(item => item.Downloads).ToList(); // order by popularity
return await GetJsonAsync<List<Package>>($"{Apiurl}?type={type}&search={WebUtility.UrlEncode(search)}");
}
public async Task DownloadPackageAsync(string packageId, string version, string folder)