We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2efa7e commit ce87f0dCopy full SHA for ce87f0d
1 file changed
backend/src/database/repositories/segmentRepository.ts
@@ -480,10 +480,14 @@ class SegmentRepository extends RepositoryBase<
480
f.name AS foundation_name,
481
COUNT(DISTINCT p.id)::int AS project_count
482
FROM segments f
483
- LEFT JOIN segments p
+ JOIN segments p
484
ON p."parentSlug" = f."slug"
485
AND p."grandparentSlug" IS NULL
486
AND p."tenantId" = f."tenantId"
487
+ JOIN segments sp
488
+ ON sp."parentSlug" = p."slug"
489
+ AND sp."grandparentSlug" = f.slug
490
+ AND sp."tenantId" = f."tenantId"
491
WHERE f."parentSlug" IS NULL
492
AND f."tenantId" = :tenantId
493
${segmentsSearchQuery}
0 commit comments