Skip to content

Commit ce87f0d

Browse files
committed
fix: exclude projectGroups with 0 projects or subprojects in dropdown
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
1 parent d2efa7e commit ce87f0d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

backend/src/database/repositories/segmentRepository.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,14 @@ class SegmentRepository extends RepositoryBase<
480480
f.name AS foundation_name,
481481
COUNT(DISTINCT p.id)::int AS project_count
482482
FROM segments f
483-
LEFT JOIN segments p
483+
JOIN segments p
484484
ON p."parentSlug" = f."slug"
485485
AND p."grandparentSlug" IS NULL
486486
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"
487491
WHERE f."parentSlug" IS NULL
488492
AND f."tenantId" = :tenantId
489493
${segmentsSearchQuery}

0 commit comments

Comments
 (0)