From 7cb1546934d8422748001085931caeab37f6ed18 Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 11 Mar 2026 12:09:23 +0100 Subject: [PATCH] Add Reject endpoint to AnnotationController Introduced a new Reject endpoint for users with the ReceiverFull role to reject annotations, with optional reason support. Marked the endpoint as obsolete for future exception handling updates. Also standardized the Unauthorized response to remove the custom error message. --- EnvelopeGenerator.Web/Controllers/AnnotationController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EnvelopeGenerator.Web/Controllers/AnnotationController.cs b/EnvelopeGenerator.Web/Controllers/AnnotationController.cs index aacd27de..0cecccf0 100644 --- a/EnvelopeGenerator.Web/Controllers/AnnotationController.cs +++ b/EnvelopeGenerator.Web/Controllers/AnnotationController.cs @@ -81,6 +81,7 @@ public class AnnotationController : ControllerBase return Ok(); } + //TODO: add logic to check if it is already rejected or signed [Authorize(Roles = Role.ReceiverFull)] [HttpPost("reject")] [Obsolete("Use DigitalData.Core.Exceptions and .Middleware")] @@ -101,7 +102,7 @@ public class AnnotationController : ControllerBase if (envRcvRes.IsFailed) { _logger.LogNotice(envRcvRes.Notices); - return Unauthorized("you are not authirized"); + return Unauthorized(); } var histRes = await _histService.RecordAsync(envRcvRes.Data.EnvelopeId, userReference: mail, EnvelopeStatus.DocumentRejected, comment: reason);