From 92525ab45a5981acc29dd4a9ed40c6e40dfc1a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20H=C3=B6nnig?= Date: Fri, 11 Oct 2024 19:08:23 +0200 Subject: [PATCH] merging aftermaths --- .../relation/HsOfficeRelationController.java | 10 ++--- .../HsOfficeRelationRbacRepository.java | 38 ++----------------- 2 files changed, 7 insertions(+), 41 deletions(-) diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationController.java b/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationController.java index 0ebb0c9b..29078bb3 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationController.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationController.java @@ -54,14 +54,10 @@ public class HsOfficeRelationController implements HsOfficeRelationsApi { context.define(currentSubject, assumedRoles); final List entities = - ( personData == null && contactData == null ) - ? relationRbacRepo.findRelationRelatedToPersonUuidRelationTypePersonAndContactData(personUuid, + relationRbacRepo.findRelationRelatedToPersonUuidRelationTypePersonAndContactData( + personUuid, relationType == null ? null : HsOfficeRelationType.valueOf(relationType.name()), - personData, contactData) - : relationRbacRepo.findRelationRelatedToPersonUuidRelationTypePersonAndContactData( - personUuid, - relationType == null ? null : HsOfficeRelationType.valueOf(relationType.name()), - forLike(personData), forLike(contactData)); + personData, contactData); final var resources = mapper.mapList(entities, HsOfficeRelationResource.class, RELATION_ENTITY_TO_RESOURCE_POSTMAPPER); diff --git a/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationRbacRepository.java b/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationRbacRepository.java index 69771dcd..96d4b8d5 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationRbacRepository.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/office/relation/HsOfficeRelationRbacRepository.java @@ -28,10 +28,10 @@ public interface HsOfficeRelationRbacRepository extends Repository findRelationRelatedToPersonUuidRelationTypePersonAndContactData( - UUID personUuid, - HsOfficeRelationType relationType, - String personData, - String contactData) { + final UUID personUuid, + final HsOfficeRelationType relationType, + final String personData, + final String contactData) { return findRelationRelatedToPersonUuidRelationTypePersonAndContactDataImpl( personUuid, toStringOrNull(relationType), toSqlLikeOperand(personData), toSqlLikeOperand(contactData)); } @@ -57,36 +57,6 @@ public interface HsOfficeRelationRbacRepository extends Repository findRelationRelatedToPersonUuidRelationTypePersonAndContactData( - UUID personUuid, - HsOfficeRelationType relationType, - String personData, - String contactData); - HsOfficeRelationRbacEntity save(final HsOfficeRelationRbacEntity entity); long count();