Adding entries and groups works again

Entry history almost fully functional
Some refactoring
This commit is contained in:
Geoffroy BONNEVILLE
2020-04-03 17:33:53 +02:00
parent 36aa8914fa
commit b875f3c89d
12 changed files with 75 additions and 40 deletions

View File

@@ -191,7 +191,7 @@ namespace ModernKeePass.Infrastructure.KeePass
{
var parentPwGroup = _pwDatabase.RootGroup.FindGroup(BuildIdFromString(parentGroupId), true);
var pwGroup = _pwDatabase.RootGroup.FindGroup(BuildIdFromString(groupId), true);
parentPwGroup.Groups.Add(pwGroup);
parentPwGroup.AddGroup(pwGroup, true);
});
}
public async Task RemoveEntry(string parentGroupId, string entryId)
@@ -288,7 +288,7 @@ namespace ModernKeePass.Infrastructure.KeePass
{
var pwEntry = new PwEntry(true, true);
var parentPwGroup = _pwDatabase.RootGroup.FindGroup(BuildIdFromString(parentGroupId), true);
parentPwGroup.Entries.Add(pwEntry);
parentPwGroup.AddEntry(pwEntry, true);
return _mapper.Map<EntryEntity>(pwEntry);
}
@@ -297,7 +297,7 @@ namespace ModernKeePass.Infrastructure.KeePass
{
var pwGroup = new PwGroup(true, true, name, isRecycleBin? PwIcon.TrashBin : PwIcon.Folder);
var parentPwGroup = _pwDatabase.RootGroup.FindGroup(BuildIdFromString(parentGroupId), true);
parentPwGroup.Groups.Add(pwGroup);
parentPwGroup.AddGroup(pwGroup, true);
if (isRecycleBin) _pwDatabase.RecycleBinUuid = pwGroup.Uuid;
return _mapper.Map<GroupEntity>(pwGroup);