File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
server/src/main/java/invite Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 3131import io .swagger .v3 .oas .annotations .security .SecurityRequirement ;
3232import org .apache .commons .logging .Log ;
3333import org .apache .commons .logging .LogFactory ;
34- import org .jspecify .annotations .NonNull ;
3534import org .springframework .beans .factory .annotation .Value ;
3635import org .springframework .core .io .Resource ;
3736import org .springframework .http .MediaType ;
@@ -261,9 +260,10 @@ private boolean sendInvitation(CRMContact crmContact) {
261260 return optionalUser .isEmpty ();
262261 }
263262
264- private @ NonNull List <Role > convertCrmRolesToInviteRoles (CRMContact crmContact , List <CRMRole > newCrmRoles ) {
263+ private List <Role > convertCrmRolesToInviteRoles (CRMContact crmContact , List <CRMRole > newCrmRoles ) {
265264 return newCrmRoles .stream ()
266- .map (crmRole -> roleRepository .findByCrmRoleId (crmRole .getRoleId ())
265+ .map (crmRole -> roleRepository .findByCrmRoleIdAndCrmOrganisationId (
266+ crmRole .getRoleId (), crmContact .getOrganisation ().getOrganisationId ())
267267 .orElseGet (() -> this .createRole (crmContact .getOrganisation (), crmRole )))
268268 .toList ();
269269 }
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ SELECT COUNT(r.id) FROM roles r WHERE r.organization_guid = ?1
9696
9797 Optional <Role > findByName (String name );
9898
99- Optional <Role > findByCrmRoleId (String crmRoleId );
99+ Optional <Role > findByCrmRoleIdAndCrmOrganisationId (String crmRoleId , String crmOrganisationId );
100100
101101 @ Override
102102 default String rewrite (String query , Sort sort ) {
You can’t perform that action at this time.
0 commit comments