Skip to content

Commit

Permalink
Improve autocomplete search for organizations (#2687)
Browse files Browse the repository at this point in the history
  • Loading branch information
joanagmaia authored Nov 14, 2024
1 parent 730b954 commit f14e18a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion backend/src/database/repositories/organizationRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,9 @@ class OrganizationRepository {
? ` INNER JOIN "organizationSegmentsAgg" osa ON osa."organizationId" = o.id AND ${
segmentId ? `osa."segmentId" = $(segmentId)` : `osa."segmentId" IS NULL`
}`
: ''
: ` LEFT JOIN "organizationSegmentsAgg" osa ON osa."organizationId" = o.id AND ${
segmentId ? `osa."segmentId" = $(segmentId)` : `osa."segmentId" IS NULL`
}`
}
WHERE 1=1
AND o."tenantId" = $(tenantId)
Expand Down
2 changes: 1 addition & 1 deletion backend/src/services/organizationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ export default class OrganizationService extends LoggerBase {
offset,
segmentId: segments.length > 0 ? segments[0] : undefined,
fields: ['id', 'segmentId', 'displayName', 'memberCount', 'activityCount', 'logo'],
include: { aggregates: true, identities: false, lfxMemberships: true },
include: { aggregates: false, identities: false, lfxMemberships: true },
},
this.options,
)
Expand Down

0 comments on commit f14e18a

Please sign in to comment.