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
@@ -22,7 +22,7 @@ internal sealed class GetAllEmailTemplatesHandler
protected override async Task<ServiceResult<IReadOnlyList<EmailTemplate>>> DoOnHandle(
GetAllEmailTemplatesQuery request, CancellationToken cancellationToken)
{
var templates = await _templates.GetAllAsync(cancellationToken);
var templates = await _templates.GetAllAsync(request.ServiceName, request.Key, cancellationToken);
return Success(templates);
}
}
@@ -4,4 +4,5 @@ using HrynCo.NotificationService.Services.Core;
namespace HrynCo.NotificationService.Services.EmailTemplates.GetAll;
public sealed record GetAllEmailTemplatesQuery : IRequest<ServiceResult<IReadOnlyList<EmailTemplate>>>;
public sealed record GetAllEmailTemplatesQuery(string? ServiceName = null, string? Key = null)
: IRequest<ServiceResult<IReadOnlyList<EmailTemplate>>>;