feat: add filtering by ServiceName and Key in email templates query and UI

This commit is contained in:
2026-05-17 11:43:25 +03:00
parent 3381fcc2f8
commit 07f536938f
7 changed files with 56 additions and 10 deletions
@@ -1,6 +1,7 @@
using HrynCo.NotificationService.Web.Infrastructure;
using HrynCo.NotificationService.Services.EmailTemplates.Create;
using HrynCo.NotificationService.Services.EmailTemplates.Delete;
using HrynCo.NotificationService.Services.EmailTemplates.GetAll;
using HrynCo.NotificationService.Services.EmailTemplates.Get;
using HrynCo.NotificationService.Services.EmailTemplates.GetByService;
using HrynCo.NotificationService.Services.EmailTemplates.Update;
@@ -15,9 +16,9 @@ public sealed class EmailTemplatesController : ApiControllerBase
public EmailTemplatesController(IMediator mediator) : base(mediator) { }
[HttpGet]
public async Task<IActionResult> GetAll([FromQuery] string serviceName, CancellationToken cancellationToken)
public async Task<IActionResult> GetAll([FromQuery] string? serviceName, [FromQuery] string? key, CancellationToken cancellationToken)
{
var result = await Mediator.Send(new GetEmailTemplatesQuery(serviceName), cancellationToken);
var result = await Mediator.Send(new GetAllEmailTemplatesQuery(serviceName, key), cancellationToken);
return FromServiceResult(result);
}