feat(api): Application GetAll, Work GetAll - добавлены фильтры по id
This commit is contained in:
@@ -14,5 +14,11 @@ namespace PARR.API.Contracts.V1.Requests.Queries
|
||||
/// Поиск по типу
|
||||
/// </summary>
|
||||
public Guid? TypeId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Поиск по ИД
|
||||
/// </summary>
|
||||
public Guid? Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,5 +11,10 @@
|
||||
/// Поиск по имени. Например: "прочее"
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Поиск по ИД
|
||||
/// </summary>
|
||||
public Guid? Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,9 @@ namespace PARR.API.Controllers.V1
|
||||
if (filter.TypeId.HasValue)
|
||||
query = query.Where(t => t.ApplicationTypeId == filter.TypeId);
|
||||
|
||||
if (filter.Id.HasValue)
|
||||
query = query.Where(t => t.Id == filter.Id);
|
||||
|
||||
|
||||
var apps = await applicationService.GetPage(query, paginationFilter).ToListAsync();
|
||||
|
||||
|
||||
@@ -65,6 +65,9 @@ namespace PARR.API.Controllers.V1
|
||||
if (!string.IsNullOrWhiteSpace(filter.Name))
|
||||
query = query.Where(t => t.Name.ToLower().Contains(filter.Name.ToLower()));
|
||||
|
||||
if (filter.Id.HasValue)
|
||||
query = query.Where(t => t.Id == filter.Id);
|
||||
|
||||
|
||||
var works = await workService.GetPage(query, paginationFilter).ToListAsync();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user