Container refresh, delete multiple, preview fix

This commit is contained in:
2023-07-11 16:32:04 +02:00
parent ed5d5806ae
commit b1898e1120
6 changed files with 46 additions and 7 deletions

View File

@@ -8,16 +8,19 @@ public class DeleteCommand : CommandBase, IExecutableCommand
{
private readonly IContentAccessorFactory _contentAccessorFactory;
private readonly ITimelessContentProvider _timelessContentProvider;
private readonly ICommandSchedulerNotifier _commandSchedulerNotifier;
public bool HardDelete { get; set; }
public List<FullName> ItemsToDelete { get; } = new();
public DeleteCommand(
IContentAccessorFactory contentAccessorFactory,
ITimelessContentProvider timelessContentProvider)
ITimelessContentProvider timelessContentProvider,
ICommandSchedulerNotifier commandSchedulerNotifier)
: base("Delete")
{
_contentAccessorFactory = contentAccessorFactory;
_timelessContentProvider = timelessContentProvider;
_commandSchedulerNotifier = commandSchedulerNotifier;
}
public override Task<CanCommandRun> CanRun(PointInTime currentTime)
@@ -74,6 +77,11 @@ public class DeleteCommand : CommandBase, IExecutableCommand
itemDeleters,
deleteStrategy
);
if (container.FullName is not null)
{
await _commandSchedulerNotifier.RefreshContainer(container.FullName);
}
}
await itemDeleter.DeleteAsync(itemToDelete.Provider, itemToDelete.FullName!);