Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions backend/src/database/repositories/organizationRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1491,14 +1491,8 @@ class OrganizationRepository {
SELECT
${fields}
FROM organizations o
${
withAggregates
? ` INNER JOIN "organizationSegmentsAgg" osa ON osa."organizationId" = o.id AND ${
Comment thread
ulemons marked this conversation as resolved.
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`
}`
LEFT JOIN "organizationSegmentsAgg" osa ON osa."organizationId" = o.id AND ${
Comment thread
ulemons marked this conversation as resolved.
segmentId ? `osa."segmentId" = $(segmentId)` : `osa."segmentId" IS NULL`
}
Comment thread
ulemons marked this conversation as resolved.
LEFT JOIN "organizationEnrichments" oe ON oe."organizationId" = o.id
WHERE 1=1
Expand Down
Loading