Ripristinata cancellazione documenti
This commit is contained in:
@@ -214,14 +214,14 @@
|
||||
@if (item.p.Type == AttachedDTO.TypeAttached.Position)
|
||||
{
|
||||
<MudChip T="string" Icon="@Icons.Material.Rounded.LocationOn" Color="Color.Success"
|
||||
OnClick="() => OpenPosition(item.p)" OnClose="() => OnRemoveAttached(item.index)">
|
||||
OnClick="@(() => OpenPosition(item.p))" OnClose="@(() => OnRemoveAttached(item.index))">
|
||||
@item.p.Description
|
||||
</MudChip>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudChip T="string" Color="Color.Default" OnClick="() => OpenAttached(item.p)"
|
||||
OnClose="() => OnRemoveAttached(item.index)">
|
||||
<MudChip T="string" Color="Color.Default" OnClick="@(() => OpenAttached(item.p))"
|
||||
OnClose="@(() => OnRemoveAttached(item.index))">
|
||||
@item.p.Name
|
||||
</MudChip>
|
||||
}
|
||||
@@ -232,7 +232,7 @@
|
||||
{
|
||||
foreach (var file in ActivityFileList)
|
||||
{
|
||||
<MudChip T="string" OnClick="() => OpenAttached(file.Id, file.FileName)" Color="Color.Default">
|
||||
<MudChip T="string" OnClick="@(() => OpenAttached(file.Id, file.FileName))" OnClose="@(() => DeleteAttach(file))" Color="Color.Default">
|
||||
@file.FileName
|
||||
</MudChip>
|
||||
}
|
||||
@@ -775,6 +775,33 @@
|
||||
}
|
||||
}
|
||||
|
||||
private async Task DeleteAttach(ActivityFileDto file)
|
||||
{
|
||||
Snackbar.Clear();
|
||||
|
||||
if (ActivityFileList == null) return;
|
||||
|
||||
try
|
||||
{
|
||||
ActivityFileList.Remove(file);
|
||||
StateHasChanged();
|
||||
|
||||
await IntegryApiService.DeleteFile(ActivityModel.ActivityId!, file.FileName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ActivityFileList.Add(file);
|
||||
StateHasChanged();
|
||||
|
||||
Snackbar.Add("Impossibile eliminare il file", Severity.Error);
|
||||
Console.WriteLine($"Impossibile eliminare il file: {ex.Message}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Snackbar.Add($"{file.FileName} eliminato con successo", Severity.Info);
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenPosition(AttachedDTO attached)
|
||||
{
|
||||
if (attached is { Lat: not null, Lng: not null })
|
||||
|
||||
@@ -160,7 +160,7 @@ public class IntegryApiService(IIntegryApiRestClient integryApiRestClient, IUser
|
||||
}
|
||||
|
||||
public Task<Stream> DownloadFile(string activityId, string fileName) =>
|
||||
integryApiRestClient.Download($"downloadStbFileAttachment/{activityId}/{fileName}")!;
|
||||
integryApiRestClient.Download($"downloadStbActivityFileAttachment/{activityId}/{fileName}")!;
|
||||
|
||||
public Task<Stream> DownloadFileFromRefUuid(string refUuid, string fileName)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user