diff --git a/PARR.API/Contracts/V1/Requests/Queries/TemplateQuery.cs b/PARR.API/Contracts/V1/Requests/Queries/TemplateQuery.cs index a8682581..44a9af00 100644 --- a/PARR.API/Contracts/V1/Requests/Queries/TemplateQuery.cs +++ b/PARR.API/Contracts/V1/Requests/Queries/TemplateQuery.cs @@ -11,5 +11,11 @@ /// Поиск по маске. Например: "*-ДВС" /// public string? Mask { get; set; } + + + /// + /// Поиск по ИД Задания (ApplicationInWorkId) + /// + public Guid? AppInWorkId { get; set; } } } diff --git a/PARR.API/Controllers/V1/TemplateController.cs b/PARR.API/Controllers/V1/TemplateController.cs index 77a12f00..03cf6bc1 100644 --- a/PARR.API/Controllers/V1/TemplateController.cs +++ b/PARR.API/Controllers/V1/TemplateController.cs @@ -64,6 +64,9 @@ namespace PARR.API.Controllers.V1 if (!string.IsNullOrEmpty(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(); if (!templates.Any())