The `GetDocumentOfReceiver` method was introduced to handle retrieving a document for a specified envelope key. It is secured with the `[Authorize(Policy = AuthPolicy.Receiver)]` attribute and responds to HTTP GET requests with a route parameter `envelopeKey`. The previous logic for extracting and validating the `envelopeId` from user claims was removed. This was replaced with a call to `User.GetEnvelopeIdOfReceiver()` for improved clarity and maintainability. The method uses the `mediator` to send a `ReadDocumentQuery` and returns a `NotFound` response if the document's `ByteData` is empty.
3.2 KiB
3.2 KiB