refactor(EnvelopeController): update EnvelopeReceiverReadOnly to use without then-calback-method

This commit is contained in:
tekh 2025-09-22 13:26:09 +02:00
parent 95fd16fff0
commit e2df610544

View File

@ -367,9 +367,14 @@ public class EnvelopeController : ViewControllerBase
if (DateTime.Now > erro.DateValid) if (DateTime.Now > erro.DateValid)
return View("EnvelopeExpired"); return View("EnvelopeExpired");
return await _envRcvService.ReadByUuidSignatureAsync(uuid: erro.Envelope!.Uuid, erro.Receiver!.Signature).ThenAsync( var erRes = await _envRcvService.ReadByUuidSignatureAsync(uuid: erro.Envelope!.Uuid, erro.Receiver!.Signature);
SuccessAsync: async er => if (erRes.IsFailed)
{ {
_logger.LogNotice(erRes.Notices);
return this.ViewEnvelopeNotFound();
}
var er = erRes.Data;
var envelopeKey = (er.Envelope!.Uuid, er.Receiver!.Signature).ToEnvelopeKey(); var envelopeKey = (er.Envelope!.Uuid, er.Receiver!.Signature).ToEnvelopeKey();
//TODO: implement multi-threading to history process (Task) //TODO: implement multi-threading to history process (Task)
@ -396,11 +401,5 @@ public class EnvelopeController : ViewControllerBase
_logger.LogEnvelopeError(envelopeReceiverId: envelopeKey, message: "No document byte-data was found in ENVELOPE_DOCUMENT table."); _logger.LogEnvelopeError(envelopeReceiverId: envelopeKey, message: "No document byte-data was found in ENVELOPE_DOCUMENT table.");
return this.ViewDocumentNotFound(); return this.ViewDocumentNotFound();
} }
},
Fail: (messages, notices) =>
{
_logger.LogNotice(notices);
return this.ViewEnvelopeNotFound();
});
} }
} }