Only check rejection for read-and-sign envelopes
Previously, rejection checks were performed for all envelopes. Now, the code checks for rejecting receivers only if the envelope is of the "read-and-sign" type, avoiding unnecessary queries and logic for other envelope types.
This commit is contained in:
@@ -7,6 +7,7 @@ using EnvelopeGenerator.Application.Common.Interfaces.Services;
|
|||||||
using EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
|
using EnvelopeGenerator.Application.EnvelopeReceivers.Queries;
|
||||||
using EnvelopeGenerator.Application.Resources;
|
using EnvelopeGenerator.Application.Resources;
|
||||||
using EnvelopeGenerator.Domain.Constants;
|
using EnvelopeGenerator.Domain.Constants;
|
||||||
|
using EnvelopeGenerator.Domain.Interfaces;
|
||||||
using EnvelopeGenerator.PdfEditor;
|
using EnvelopeGenerator.PdfEditor;
|
||||||
using EnvelopeGenerator.Web.Extensions;
|
using EnvelopeGenerator.Web.Extensions;
|
||||||
using EnvelopeGenerator.Web.Models;
|
using EnvelopeGenerator.Web.Models;
|
||||||
@@ -162,13 +163,16 @@ public class EnvelopeController : ViewControllerBase
|
|||||||
}
|
}
|
||||||
var er_secret = er_secret_res.Data;
|
var er_secret = er_secret_res.Data;
|
||||||
|
|
||||||
//check rejection
|
//check rejection if the envelope is read-and-sign
|
||||||
var rejRcvrs = await _historyService.ReadRejectingReceivers(er_secret.Envelope!.Id);
|
if (er_secret.Envelope.IsReadAndSign())
|
||||||
if (rejRcvrs.Any())
|
|
||||||
{
|
{
|
||||||
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
var rejRcvrs = await _historyService.ReadRejectingReceivers(er_secret.Envelope!.Id);
|
||||||
ViewBag.IsExt = !rejRcvrs.Contains(er_secret.Receiver); //external if the current user is not rejected
|
if (rejRcvrs.Any())
|
||||||
return View("EnvelopeRejected", er_secret);
|
{
|
||||||
|
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
||||||
|
ViewBag.IsExt = !rejRcvrs.Contains(er_secret.Receiver); //external if the current user is not rejected
|
||||||
|
return View("EnvelopeRejected", er_secret);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// show envelope if already logged in
|
// show envelope if already logged in
|
||||||
|
|||||||
Reference in New Issue
Block a user