Fix downloadFile

This commit is contained in:
2025-12-30 17:40:08 +01:00
parent 37d66c90d2
commit ce86cba86c
17 changed files with 168 additions and 47 deletions

View File

@@ -1,3 +1,4 @@
@using salesbook.Shared.Components.Layout.Spinner
@using salesbook.Shared.Core.Dto
@using salesbook.Shared.Core.Interface
@using salesbook.Shared.Core.Interface.IntegryApi
@@ -34,12 +35,24 @@
</div>
</div>
<OverlayLayout Visible="VisibleOverlay" />
@code {
[Parameter] public CRMAttachedResponseDTO Attached { get; set; } = new();
private bool VisibleOverlay { get; set; }
private async Task OpenAttached()
{
var bytes = await IntegryApiService.DownloadFileFromRefUuid(Attached.RefUuid, Attached.FileName);
await AttachedService.OpenFile(bytes, Attached.FileName);
VisibleOverlay = true;
StateHasChanged();
await using var file = await IntegryApiService.DownloadFileFromRefUuid(Attached.RefUuid, Attached.FileName);
var path = await AttachedService.SaveToTempStorage(file, Attached.FileName);
VisibleOverlay = false;
StateHasChanged();
await AttachedService.OpenFile(Attached.FileName, path);
}
}