create relation with holder- and contact-data, and search for contact emailAddress + relation mark #136

Merged
hsh-michaelhoennig merged 12 commits from feature/create-relation-with-holder-and-contact-data into master 2024-12-13 14:09:03 +01:00
Showing only changes of commit ee0e59bd55 - Show all commits

View File

@ -44,9 +44,10 @@ public class HsOfficeContactController implements HsOfficeContactsApi {
context.define(currentSubject, assumedRoles);
validate("caption, emailAddress").atMaxOne(caption, emailAddress);
final var entities = caption != null
? contactRepo.findContactByOptionalCaptionLike(caption)
: contactRepo.findContactByEmailAddress(emailAddress);
final var entities = emailAddress != null
? contactRepo.findContactByEmailAddress(emailAddress)
: contactRepo.findContactByOptionalCaptionLike(caption);
final var resources = mapper.mapList(entities, HsOfficeContactResource.class);
return ResponseEntity.ok(resources);