Web search result fixed

This commit is contained in:
2025-02-01 19:44:31 +00:00
parent 913f2ae5dd
commit bc1464db7f
13 changed files with 146 additions and 35 deletions

View File

@ -28,11 +28,19 @@ namespace isnd.Controllers
Query = model
};
List<Catalog> registrations = new List<Catalog>();
foreach (var pk in pkgs.data.GroupBy(x => x.PackageId))
if (pkgs.data!=null)
if (pkgs.data.Length>0)
{
registrations.Add(new Catalog(apiBase, pk.Key, pkgs.GetResults().Single(p=>p.Id == pk.Key).Versions));
var grouped = pkgs.data.GroupBy(x => x.PackageId);
if (grouped!=null) if (grouped.Count()>0)
{
foreach (var pk in grouped.ToArray())
{
registrations.Add(new Catalog(apiBase, pk.Key, pkgs.GetResults().Single(p=>p.Id == pk.Key).Versions));
}
}
}
return View(new RegistrationPageIndexQueryAndResult
{
Source = packageManager.CatalogBaseUrl+ApiConfig.Index,
@ -80,7 +88,7 @@ namespace isnd.Controllers
.FirstOrDefaultAsync(m => m.PackageId == pkgid && m.FullString == version
&& (pkgtype!=null && m.Type == pkgtype || m.Type != "Delete" ));
if (packageVersion == null) return NotFound();
if (!User.IsOwner(packageVersion)) return Unauthorized();
if (!User.IsOwner(packageVersion)) return Challenge();
var pkg = await packageManager.GetPackageDetailsAsync(pkgid, version, pkgtype);
return View(pkg);
}