Skip to content

Commit

Permalink
Resolve [301] add search mail params on organizations
Browse files Browse the repository at this point in the history
Signed-off-by: Donatien Eneman <[email protected]>
  • Loading branch information
Donatien26 authored and CChemin committed May 3, 2021
1 parent e9d9ec7 commit 0d1151d
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ public ResponseEntity<?> getOrganizations(
required = false)
@RequestParam(value = "identifiant", required = false)
String identifiant,
@Parameter(description = "Organization's mail of the wanted organization", required = false)
@RequestParam(value = "mail", required = false)
String email,
@Parameter(description = "Expected size of result", required = false)
@RequestParam(value = "size", defaultValue = "20")
int size,
Expand All @@ -101,8 +104,8 @@ public ResponseEntity<?> getOrganizations(
SearchType typeRecherche) {
Organization filterOrganization = new Organization();
filterOrganization.setIdentifiant(identifiant);
filterOrganization.addAttributes("mail", email);
PageableResult pageableResult = new PageableResult(size, offset);

PageResult<Organization> foundOrganizations =
organizationService.findByProperties(
realm, storage, filterOrganization, pageableResult, typeRecherche);
Expand Down Expand Up @@ -148,6 +151,9 @@ public ResponseEntity<?> getOrganizations(
required = false)
@RequestParam(value = "identifiant", required = false)
String identifiant,
@Parameter(description = "Organization's mail of the wanted organization", required = false)
@RequestParam(value = "mail", required = false)
String email,
@Parameter(description = "Expected size of result", required = false)
@RequestParam(value = "size", defaultValue = "20")
int size,
Expand All @@ -157,7 +163,7 @@ public ResponseEntity<?> getOrganizations(
@Parameter(description = "Default search can be AND or OR", required = true)
@RequestParam(name = "typeRecherche", defaultValue = "AND", required = true)
SearchType typeRecherche) {
return getOrganizations(realm, null, identifiant, size, offset, typeRecherche);
return getOrganizations(realm, null, identifiant, email, size, offset, typeRecherche);
}

@PostMapping(
Expand Down

0 comments on commit 0d1151d

Please sign in to comment.