feat(TestAnnotationController): include receiver signature in RemoveSignatureNotification
Updated TestAnnotationController.Delete to extract the receiver signature from the envelope key and pass it along with the envelope UUID when publishing RemoveSignatureNotification. Returns BadRequest if the signature is missing.
This commit is contained in:
parent
17c7e46388
commit
02ecd88758
@ -9,7 +9,7 @@ namespace EnvelopeGenerator.Web.Controllers.Test;
|
|||||||
[ApiController]
|
[ApiController]
|
||||||
public class TestAnnotationController : ControllerBase
|
public class TestAnnotationController : ControllerBase
|
||||||
{
|
{
|
||||||
private IMediator _mediator;
|
private readonly IMediator _mediator;
|
||||||
|
|
||||||
public TestAnnotationController(IMediator mediator)
|
public TestAnnotationController(IMediator mediator)
|
||||||
{
|
{
|
||||||
@ -19,12 +19,17 @@ public class TestAnnotationController : ControllerBase
|
|||||||
[HttpDelete("{envelopeKey}")]
|
[HttpDelete("{envelopeKey}")]
|
||||||
public async Task<IActionResult> Delete([FromRoute] string envelopeKey)
|
public async Task<IActionResult> Delete([FromRoute] string envelopeKey)
|
||||||
{
|
{
|
||||||
var uuid = envelopeKey.GetEnvelopeUuid();
|
if (envelopeKey.GetEnvelopeUuid() is not string uuid)
|
||||||
|
|
||||||
if (uuid == null)
|
|
||||||
return BadRequest();
|
return BadRequest();
|
||||||
|
|
||||||
await _mediator.Publish(new RemoveSignatureNotification(uuid));
|
if (envelopeKey.GetReceiverSignature() is not string signature)
|
||||||
|
return BadRequest();
|
||||||
|
|
||||||
|
await _mediator.Publish(new RemoveSignatureNotification()
|
||||||
|
{
|
||||||
|
EnvelopeUuid = uuid,
|
||||||
|
ReceiverSignature = signature
|
||||||
|
});
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user