From 32b64e3ab505728d52e9edd43e38b7c16d2fab18 Mon Sep 17 00:00:00 2001 From: Terje Holene Date: Thu, 24 Oct 2024 17:16:03 +0200 Subject: [PATCH] Use instance.Org in place of the parameter org where available --- .../Controllers/ContentOnDemandController.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Storage/Controllers/ContentOnDemandController.cs b/src/Storage/Controllers/ContentOnDemandController.cs index 91b573c3..9edc1341 100644 --- a/src/Storage/Controllers/ContentOnDemandController.cs +++ b/src/Storage/Controllers/ContentOnDemandController.cs @@ -79,8 +79,8 @@ public async Task GetSignatureAsHtml([FromRoute] string org, [From List view = await JsonSerializer.DeserializeAsync>( await _blobRepository.ReadBlob( - $"{(_generalSettings.A2UseTtdAsServiceOwner ? "ttd" : org)}", - $"{org}/{app}/{instanceGuid}/data/{signatureElement.Id}", + $"{(_generalSettings.A2UseTtdAsServiceOwner ? "ttd" : instance.Org)}", + $"{instance.Org}/{app}/{instanceGuid}/data/{signatureElement.Id}", application.StorageContainerNumber)); return View("Signature", view); @@ -104,8 +104,8 @@ public async Task GetPaymentAsHtml([FromRoute] string org, [FromRo PaymentView view = await JsonSerializer.DeserializeAsync( await _blobRepository.ReadBlob( - $"{(_generalSettings.A2UseTtdAsServiceOwner ? "ttd" : org)}", - $"{org}/{app}/{instanceGuid}/data/{paymentElement.Id}", + $"{(_generalSettings.A2UseTtdAsServiceOwner ? "ttd" : instance.Org)}", + $"{instance.Org}/{app}/{instanceGuid}/data/{paymentElement.Id}", application.StorageContainerNumber)); return View("Payment", view); @@ -133,7 +133,7 @@ public async Task GetFormdataAsPdf([FromRoute] string org, [FromRoute] s int lformid = int.Parse(xmlElement.Metadata.First(m => m.Key == "lformid").Value); PrintViewXslBEList xsls = []; int pageNumber = 1; - foreach ((string xsl, bool isPortrait) in await _a2Repository.GetXsls(org, app, lformid, language, 3)) + foreach ((string xsl, bool isPortrait) in await _a2Repository.GetXsls(instance.Org, app, lformid, language, 3)) { if (visiblePages == null || visiblePages.Contains(pageNumber)) { @@ -220,7 +220,7 @@ private async Task GetFormdataAsHtmlInternal(string org, string app, Gui PrintViewXslBEList xsls = []; int lformid = int.Parse(xmlElement.Metadata.First(m => m.Key == "lformid").Value); int pageNumber = 1; - foreach ((string xsl, bool isPortrait) in await _a2Repository.GetXsls(org, app, lformid, language, viewType)) + foreach ((string xsl, bool isPortrait) in await _a2Repository.GetXsls(instance.Org, app, lformid, language, viewType)) { if ((singlePageNr != -1 && singlePageNr == pageNumber) || (singlePageNr == -1 && (visiblePages == null || visiblePages.Contains(pageNumber)))) { @@ -234,7 +234,7 @@ private async Task GetFormdataAsHtmlInternal(string org, string app, Gui return _a2OndemandFormattingService.GetFormdataHtml( xsls, - await _blobRepository.ReadBlob($"{(_generalSettings.A2UseTtdAsServiceOwner ? "ttd" : org)}", $"{org}/{app}/{instanceGuid}/data/{xmlElement.Id}", application.StorageContainerNumber), + await _blobRepository.ReadBlob($"{(_generalSettings.A2UseTtdAsServiceOwner ? "ttd" : instance.Org)}", $"{instance.Org}/{app}/{instanceGuid}/data/{xmlElement.Id}", application.StorageContainerNumber), xmlElement.Created.ToString()); } }