feat: add filtering by ServiceName and Key in email templates query and UI
This commit is contained in:
@@ -23,9 +23,12 @@ public class AdminTemplatesController : Controller
|
||||
|
||||
// GET /admin/templates
|
||||
[HttpGet("")]
|
||||
public async Task<IActionResult> Index(CancellationToken ct)
|
||||
public async Task<IActionResult> Index([FromQuery] string? serviceName, [FromQuery] string? key, CancellationToken ct)
|
||||
{
|
||||
var result = await _mediator.Send(new GetAllEmailTemplatesQuery(), ct);
|
||||
ViewData["ServiceNameFilter"] = serviceName;
|
||||
ViewData["KeyFilter"] = key;
|
||||
|
||||
var result = await _mediator.Send(new GetAllEmailTemplatesQuery(serviceName, key), ct);
|
||||
if (!result.IsSuccess)
|
||||
{
|
||||
ModelState.AddModelError("", result.Error?.Message ?? "Failed to load templates.");
|
||||
|
||||
Reference in New Issue
Block a user