Filter Layers by Type
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user