feat: added Remove Button for removing Privte Entity from PrivateList
This commit is contained in:
@@ -179,7 +179,9 @@
|
||||
<h5 class="modal-title">Optionen</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">Optionen...</div>
|
||||
<div class="modal-body">
|
||||
<button type="button" class="btn btn-danger" @onclick="@(e => RemoveEntityFromPrivateList(Entity))" data-bs-dismiss="modal">Aus PrivateList entfernen</button>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Schließen</button>
|
||||
</div>
|
||||
@@ -189,6 +191,16 @@
|
||||
</div>
|
||||
};
|
||||
|
||||
private async Task RemoveEntityFromPrivateList(PrivateEntity entity)
|
||||
{
|
||||
//Delete DB
|
||||
CouchLogDB.PrivateEntities.Remove(entity);
|
||||
await CouchLogDB.SaveChangesAsync();
|
||||
|
||||
//Delete Memory List
|
||||
PrivateEntities.Remove(entity);
|
||||
}
|
||||
|
||||
private async Task UpdateWatchStatus(PrivateEntity entity, object? newValue)
|
||||
{
|
||||
if (int.TryParse(newValue?.ToString(), out int newId))
|
||||
|
||||
Reference in New Issue
Block a user