create relation with holder- and contact-data, and search for contact emailAddress + relation mark #136
@ -44,9 +44,10 @@ public class HsOfficeContactController implements HsOfficeContactsApi {
|
|||||||
context.define(currentSubject, assumedRoles);
|
context.define(currentSubject, assumedRoles);
|
||||||
|
|
||||||
validate("caption, emailAddress").atMaxOne(caption, emailAddress);
|
validate("caption, emailAddress").atMaxOne(caption, emailAddress);
|
||||||
final var entities = caption != null
|
final var entities = emailAddress != null
|
||||||
? contactRepo.findContactByOptionalCaptionLike(caption)
|
? contactRepo.findContactByEmailAddress(emailAddress)
|
||||||
: contactRepo.findContactByEmailAddress(emailAddress);
|
: contactRepo.findContactByOptionalCaptionLike(caption);
|
||||||
|
|
||||||
|
|
||||||
final var resources = mapper.mapList(entities, HsOfficeContactResource.class);
|
final var resources = mapper.mapList(entities, HsOfficeContactResource.class);
|
||||||
return ResponseEntity.ok(resources);
|
return ResponseEntity.ok(resources);
|
||||||
|
Loading…
Reference in New Issue
Block a user