feat(api): TemplateController - фильтр шаблонов по AppInWorkId
This commit is contained in:
@@ -11,5 +11,11 @@
|
|||||||
/// Поиск по маске. Например: "*-ДВС"
|
/// Поиск по маске. Например: "*-ДВС"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Mask { get; set; }
|
public string? Mask { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Поиск по ИД Задания (ApplicationInWorkId)
|
||||||
|
/// </summary>
|
||||||
|
public Guid? AppInWorkId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,9 @@ namespace PARR.API.Controllers.V1
|
|||||||
if (!string.IsNullOrEmpty(filter.Mask))
|
if (!string.IsNullOrEmpty(filter.Mask))
|
||||||
query = query.Where(t => EF.Functions.Like(t.Name.ToLower(), SqlHelpers.RegexToLike(filter.Mask)));
|
query = query.Where(t => EF.Functions.Like(t.Name.ToLower(), SqlHelpers.RegexToLike(filter.Mask)));
|
||||||
|
|
||||||
|
if (filter.AppInWorkId.HasValue)
|
||||||
|
query = query.Where(t => t.ApplicationInWorkId == filter.AppInWorkId.Value);
|
||||||
|
|
||||||
var templates = await templateService.GetPage(query, paginationFilter).ToListAsync();
|
var templates = await templateService.GetPage(query, paginationFilter).ToListAsync();
|
||||||
|
|
||||||
if (!templates.Any())
|
if (!templates.Any())
|
||||||
|
|||||||
Reference in New Issue
Block a user