Filter Layers by Type
All checks were successful
Build Docker Images / test (push) Successful in 1m37s
Build Docker Images / build-and-push (push) Successful in 1m35s

This commit is contained in:
2025-12-01 13:21:45 +01:00
parent 4d7df85df1
commit 7ea5ed506e
7 changed files with 56 additions and 29 deletions

View File

@@ -92,20 +92,15 @@ public class DataInboxController : Controller
[HttpGet]
[Route("GetAll")]
public IActionResult GetAll([FromQuery] int start, [FromQuery] int limit, [FromQuery] string? name, [FromQuery] string? source)
public IActionResult GetAll([FromQuery] int start, [FromQuery] int limit, [FromQuery] string? search)
{
try
{
var query = _db.DataInbox.AsQueryable();
if (name != null)
if (!string.IsNullOrEmpty(search))
{
query = query.Where(x => x.Name.Contains(name));
}
if (source != null)
{
query = query.Where(x => x.Source.Contains(source));
query = query.Where(x => x.Name.Contains(search) || x.Source.Contains(search));
}
var totalCount = query.Count();
@@ -133,8 +128,8 @@ public class DataInboxController : Controller
PageSize = limit
};
_logger.LogDebug("GetAll: Retrieved {Count} of {TotalCount} data inbox items (page {Page}) with filter name={Name}, source={Source}",
items.Count, totalCount, pagedResult.Page, name, source);
_logger.LogDebug("GetAll: Retrieved {Count} of {TotalCount} data inbox items (page {Page}) with filter search={Search}",
items.Count, totalCount, pagedResult.Page, search);
return Ok(pagedResult);
}