Update groups finally implemented

Code cleanup
This commit is contained in:
Geoffroy BONNEVILLE
2020-04-16 17:16:03 +02:00
parent 9befdc321a
commit f950564000
15 changed files with 123 additions and 101 deletions

View File

@@ -1,12 +1,13 @@
using MediatR;
using ModernKeePass.Application.Common.Interfaces;
using ModernKeePass.Application.Entry.Models;
using ModernKeePass.Domain.Exceptions;
namespace ModernKeePass.Application.Entry.Commands.DeleteHistory
{
public class DeleteHistoryCommand : IRequest
{
public string EntryId { get; set; }
public EntryVm Entry { get; set; }
public int HistoryIndex { get; set; }
public class DeleteHistoryCommandHandler : IRequestHandler<DeleteHistoryCommand>
@@ -22,7 +23,8 @@ namespace ModernKeePass.Application.Entry.Commands.DeleteHistory
{
if (!_database.IsOpen) throw new DatabaseClosedException();
_database.DeleteHistory(message.EntryId, message.HistoryIndex);
_database.DeleteHistory(message.Entry.Id, message.HistoryIndex);
message.Entry.History.RemoveAt(message.HistoryIndex);
}
}
}