implement receiver already signed method
This commit is contained in:
@@ -44,9 +44,10 @@ public static class ReceiverAlreadySignedQueryExtensions
|
||||
/// </summary>
|
||||
/// <param name="mediator"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="cancel"></param>
|
||||
/// <returns></returns>
|
||||
public static Task<bool> ReceiverAlreadySigned(IMediator mediator, string key)
|
||||
=> mediator.Send(new ReceiverAlreadySignedQuery { Key = key });
|
||||
public static Task<bool> ReceiverAlreadySigned(this IMediator mediator, string key, CancellationToken cancel = default)
|
||||
=> mediator.Send(new ReceiverAlreadySignedQuery { Key = key }, cancel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -22,7 +22,6 @@ using DigitalData.Core.Abstraction.Application.DTO;
|
||||
using EnvelopeGenerator.Domain.Entities;
|
||||
using MediatR;
|
||||
using EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
|
||||
using EnvelopeGenerator.Application.Extensions;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers;
|
||||
|
||||
@@ -406,7 +405,7 @@ public class HomeController : ViewControllerBase
|
||||
[Authorize(Roles = ReceiverRole.FullyAuth)]
|
||||
[HttpGet("EnvelopeKey/{envelopeReceiverId}/Success")]
|
||||
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||
public async Task<IActionResult> EnvelopeSigned(string envelopeReceiverId)
|
||||
public async Task<IActionResult> EnvelopeSigned(string envelopeReceiverId, CancellationToken cancel)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -417,8 +416,8 @@ public class HomeController : ViewControllerBase
|
||||
if(!isExisting)
|
||||
return this.ViewEnvelopeNotFound();
|
||||
|
||||
EnvelopeReceiver response = await envelopeOldService.LoadEnvelope(envelopeReceiverId);
|
||||
if (!envelopeOldService.ReceiverAlreadySigned((Envelope)response.Envelope, (int)response.Receiver.Id))
|
||||
var signed = await _mediator.ReceiverAlreadySigned(envelopeReceiverId, cancel);
|
||||
if (signed)
|
||||
return base.Redirect($"/EnvelopeKey/{envelopeReceiverId}/Locked");
|
||||
|
||||
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
|
||||
Reference in New Issue
Block a user