Skip to content

Commit

Permalink
update: Update Menu operations
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGT96 committed Oct 30, 2024
1 parent e0e9af0 commit 1d8090f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public void deleteGroup(UserGroup aGroup) throws OHServiceException {
throw new OHDataValidationException(new OHExceptionMessage(MessageBundle.getMessage("angal.groupsbrowser.theadmingroupcannotbedeleted.msg")));
}
List<User> 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")));
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/isf/menu/service/MenuIoOperations.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public MenuIoOperations(
* @throws OHServiceException When error occurs
*/
public List<User> getUser() throws OHServiceException {
return repository.findAllByDeletedOrderByUserNameAsc(false);
return repository.findAllByOrderByUserNameAsc();
}

/**
Expand Down Expand Up @@ -132,7 +132,7 @@ public String getUsrInfo(String userName) throws OHServiceException {
* @throws OHServiceException When error occurs
*/
public List<UserGroup> getUserGroup() throws OHServiceException {
return groupRepository.findAllByDeletedOrderByCodeAsc(false);
return groupRepository.findAllByOrderByCodeAsc();
}

/**
Expand Down

0 comments on commit 1d8090f

Please sign in to comment.