ReadByName in EmailTemplate Repositroy und Dienst hinzugefügt.
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using DigitalData.Core.DTO;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
using EnvelopeGenerator.Application.DTOs;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using EnvelopeGenerator.Infrastructure.Contracts;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Security.Cryptography;
|
||||
using static EnvelopeGenerator.Common.Constants;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers.Test
|
||||
{
|
||||
@@ -9,7 +13,23 @@ namespace EnvelopeGenerator.Web.Controllers.Test
|
||||
{
|
||||
public TestEmailTemplateController(ILogger<TestEmailTemplateController> logger, IEmailTemplateService service) : base(logger, service)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public virtual async Task<IActionResult> GetAll([FromQuery] string? tempType = null)
|
||||
{
|
||||
return tempType is null
|
||||
? await base.GetAll()
|
||||
: await _service.ReadByNameAsync((EmailTemplateType)Enum.Parse(typeof(EmailTemplateType), tempType)).ThenAsync(
|
||||
Success: Ok,
|
||||
Fail: IActionResult (messages, notices) =>
|
||||
{
|
||||
_logger.LogNotice(notices);
|
||||
return NotFound(messages);
|
||||
});
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
public override Task<IActionResult> GetAll() => base.GetAll();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user