From ce0d4c1fb030fd28a38a4504bd9cdbf022cadf62 Mon Sep 17 00:00:00 2001 From: Mikhail Trubnikov Date: Thu, 11 Apr 2024 09:22:43 +1000 Subject: [PATCH] =?UTF-8?q?feat(api):=20TemplateController=20-=20=D1=84?= =?UTF-8?q?=D0=B8=D0=BB=D1=8C=D1=82=D1=80=20=D1=88=D0=B0=D0=B1=D0=BB=D0=BE?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=20=D0=BF=D0=BE=20AppInWorkId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PARR.API/Contracts/V1/Requests/Queries/TemplateQuery.cs | 6 ++++++ PARR.API/Controllers/V1/TemplateController.cs | 3 +++ 2 files changed, 9 insertions(+) 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())