This commit is contained in:
Jonathan Jenne 2023-11-17 14:45:55 +01:00
parent d6e3ff3875
commit 36e441106a
2 changed files with 25 additions and 35 deletions

View File

@ -41,34 +41,35 @@ namespace EnvelopeGenerator.Web.Controllers
} }
} }
[HttpPost]
[Route("api/document/{envelopeKey}")] //[HttpPost]
public async Task<IActionResult> Update(string envelopeKey) //[Route("api/document/{envelopeKey}")]
{ //public async Task<IActionResult> Update(string envelopeKey)
try //{
{ // try
logger.Info("DocumentController/Update"); // {
// logger.Info("DocumentController/Update");
// Validate Envelope Key and load envelope // // Validate Envelope Key and load envelope
envelopeService.EnsureValidEnvelopeKey(envelopeKey); // envelopeService.EnsureValidEnvelopeKey(envelopeKey);
EnvelopeResponse response = envelopeService.LoadEnvelope(envelopeKey); // EnvelopeResponse response = envelopeService.LoadEnvelope(envelopeKey);
// Load Document info // // Load Document info
var Request = ControllerContext.HttpContext.Request; // var Request = ControllerContext.HttpContext.Request;
var document = envelopeService.GetDocument(Request, envelopeKey); // var document = envelopeService.GetDocument(Request, envelopeKey);
// Update the document with new data // // Update the document with new data
await envelopeService.UpdateDocument(Request.Body, document.Filepath); // await envelopeService.UpdateDocument(Request.Body, document.Filepath);
// Add history entry // // Add history entry
envelopeService.InsertHistoryEntrySigned(response); // envelopeService.InsertHistoryEntrySigned(response);
return Ok(); // return Ok();
} // }
catch (Exception e) // catch (Exception e)
{ // {
return ErrorResponse(e); // return ErrorResponse(e);
} // }
} //}
} }
} }

View File

@ -85,19 +85,8 @@ class App {
const isFormField = !!annotation.formFieldName; const isFormField = !!annotation.formFieldName;
const isSignature = !!annotation.isSignature; const isSignature = !!annotation.isSignature;
console.log("form field", isFormField, "signature", isSignature)
//if (!isSignature) {
// return;
//}
//if (!(isFormField && isSignature)) {
// return;
//}
if (isFormField === false && isSignature === true) { if (isFormField === false && isSignature === true) {
const left = annotation.boundingBox.left - 25; const left = annotation.boundingBox.left - 25;
const top = annotation.boundingBox.top - 25; const top = annotation.boundingBox.top - 25;
const width = 150; const width = 150;