03-11-2023

This commit is contained in:
Jonathan Jenne
2023-11-03 14:12:24 +01:00
parent b08f13a7fd
commit 0b6eecc534
12 changed files with 133 additions and 404 deletions

View File

@@ -1,8 +1,9 @@
using EnvelopeGenerator.Common;
using DigitalData.Modules.Logging;
using EnvelopeGenerator.Common;
using EnvelopeGenerator.Web.Services;
using Microsoft.AspNetCore.Mvc;
using NLog;
using static EnvelopeGenerator.Web.Handler.FileHandler;
using static EnvelopeGenerator.Web.Constants;
namespace EnvelopeGenerator.Web.Controllers
{
@@ -23,7 +24,6 @@ namespace EnvelopeGenerator.Web.Controllers
[HttpGet]
[Route("api/envelope/{envelopeKey}")]
[IgnoreAntiforgeryToken]
public IActionResult Get(string envelopeKey)
{
try
@@ -50,16 +50,13 @@ namespace EnvelopeGenerator.Web.Controllers
[HttpPost]
[Route("api/envelope/{envelopeKey}")]
[IgnoreAntiforgeryToken]
public async Task<IActionResult> Update(string envelopeKey)
{
try
{
logger.Info("Handling envelope saving.");
api.EnsureValidEnvelopeKey(envelopeKey);
EnvelopeResponse r = database.LoadEnvelope(envelopeKey);
EnvelopeResponse r = api.EnsureValidEnvelopeKey(envelopeKey);
var Request = ControllerContext.HttpContext.Request;
var document = api.GetDocument(Request, envelopeKey);
@@ -71,13 +68,10 @@ namespace EnvelopeGenerator.Web.Controllers
throw new ArgumentNullException("AnnotationData");
}
State state = api.GetState(logging.LogConfig, database.MSSQL);
DocumentStatusModel model = new(state);
model.InsertOrUpdate(new DocumentStatus()
database.InsertDocumentStatus(new DocumentStatus()
{
EnvelopeId = r.Envelope.Id,
ReceiverId = r.ReceiverId,
ReceiverId = r.Receiver.Id,
Value = annotationData,
Status = Common.Constants.DocumentStatus.Signed
});