From e3c0b918bd662f92f619ab318bc228f3adcedcdc Mon Sep 17 00:00:00 2001 From: Pedro Igor Date: Fri, 16 Aug 2024 10:49:32 -0300 Subject: [PATCH] Returning a full representation when querying organizations Signed-off-by: Pedro Igor --- .../admin/resource/OrganizationMemberResource.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/services/src/main/java/org/keycloak/organization/admin/resource/OrganizationMemberResource.java b/services/src/main/java/org/keycloak/organization/admin/resource/OrganizationMemberResource.java index 41ff988150..c0bc07f409 100644 --- a/services/src/main/java/org/keycloak/organization/admin/resource/OrganizationMemberResource.java +++ b/services/src/main/java/org/keycloak/organization/admin/resource/OrganizationMemberResource.java @@ -49,6 +49,7 @@ import org.keycloak.models.UserModel; import org.keycloak.models.utils.ModelToRepresentation; import org.keycloak.organization.OrganizationProvider; +import org.keycloak.organization.utils.Organizations; import org.keycloak.representations.idm.MemberRepresentation; import org.keycloak.representations.idm.MembershipType; import org.keycloak.representations.idm.OrganizationRepresentation; @@ -192,14 +193,7 @@ public class OrganizationMemberResource { UserModel member = getUser(id); - return provider.getByMember(member).map((org) -> { - OrganizationRepresentation organization = new OrganizationRepresentation(); - - organization.setId(org.getId()); - organization.setName(org.getName()); - - return organization; - }); + return provider.getByMember(member).map(Organizations::toRepresentation); } @Path("count")