search view fixed

This commit is contained in:
Paul Schneider 2022-10-17 19:17:04 +01:00
commit 95600facf4
10 changed files with 45 additions and 67 deletions

View file

@ -27,7 +27,7 @@ namespace isnd.Controllers
[HttpGet(_pkgRootPrefix + "{apiVersion}/" + ApiConfig.Registration + "/{id}/{lower}.json")]
public IActionResult CatalogRegistration(string apiVersion, string id, string lower)
{
if (lower.Equals("index", System.StringComparison.OrdinalIgnoreCase))
if (lower.Equals("index", System.StringComparison.InvariantCultureIgnoreCase))
{
var query = new Data.Catalog.RegistrationPageIndexQuery
{
@ -39,8 +39,8 @@ namespace isnd.Controllers
// query.TotalHits = result.Items.Select(i=>i.Items.Length).Aggregate((a,b)=>a+b);
return Ok(index);
}
var leaf = packageManager.SearchById(id,lower,null);
if (leaf.Count()==0) return NotFound(new { id, lower });
var leaf = packageManager.SearchById(id, lower, null);
if (leaf.Count() == 0) return NotFound(new { id, lower });
return Ok(leaf.First());
}