From 1d8090fbf8d8c864e90c08b23bda8d2656819376 Mon Sep 17 00:00:00 2001 From: SteveGT96 Date: Wed, 30 Oct 2024 15:57:57 +0100 Subject: [PATCH] update: Update Menu operations --- src/main/java/org/isf/menu/manager/UserBrowsingManager.java | 2 +- src/main/java/org/isf/menu/service/MenuIoOperations.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/isf/menu/manager/UserBrowsingManager.java b/src/main/java/org/isf/menu/manager/UserBrowsingManager.java index 2d52215a9..9b41ddf3a 100644 --- a/src/main/java/org/isf/menu/manager/UserBrowsingManager.java +++ b/src/main/java/org/isf/menu/manager/UserBrowsingManager.java @@ -280,7 +280,7 @@ public void deleteGroup(UserGroup aGroup) throws OHServiceException { throw new OHDataValidationException(new OHExceptionMessage(MessageBundle.getMessage("angal.groupsbrowser.theadmingroupcannotbedeleted.msg"))); } List users = getUser(aGroup.getCode()); - if (users != null && !users.isEmpty()) { + if (users != null && users.stream().anyMatch(user -> !user.isDeleted())) { throw new OHDataIntegrityViolationException( new OHExceptionMessage(MessageBundle.getMessage("angal.groupsbrowser.thisgrouphasusersandcannotbedeleted.msg"))); } diff --git a/src/main/java/org/isf/menu/service/MenuIoOperations.java b/src/main/java/org/isf/menu/service/MenuIoOperations.java index 03418f42a..fa943d9d7 100644 --- a/src/main/java/org/isf/menu/service/MenuIoOperations.java +++ b/src/main/java/org/isf/menu/service/MenuIoOperations.java @@ -73,7 +73,7 @@ public MenuIoOperations( * @throws OHServiceException When error occurs */ public List getUser() throws OHServiceException { - return repository.findAllByDeletedOrderByUserNameAsc(false); + return repository.findAllByOrderByUserNameAsc(); } /** @@ -132,7 +132,7 @@ public String getUsrInfo(String userName) throws OHServiceException { * @throws OHServiceException When error occurs */ public List getUserGroup() throws OHServiceException { - return groupRepository.findAllByDeletedOrderByCodeAsc(false); + return groupRepository.findAllByOrderByCodeAsc(); } /**