Skip to content

Commit 3b0870f

Browse files
committed
fix edge case
1 parent cc29728 commit 3b0870f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

backend/src/database/repositories/organizationRepository.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,6 @@ class OrganizationRepository {
16011601

16021602
if (lfxMembershipFilter) {
16031603
const filterKey = Object.keys(lfxMembershipFilter)[0]
1604-
options.log.info('filterKey', filterKey)
16051604
if (filterKey === 'ne') {
16061605
lfxMembershipFilterWhereClause = `AND EXISTS (SELECT 1 FROM "lfxMemberships" lm WHERE lm."organizationId" = o.id AND lm."tenantId" = $(tenantId))`
16071606
} else if (filterKey === 'eq') {
@@ -1610,6 +1609,11 @@ class OrganizationRepository {
16101609

16111610
// remove lfxMembership filter from obj since filterParser doesn't support it
16121611
filter.and = filter.and.filter(f => !f.lfxMembership)
1612+
1613+
// handle edge case where filter.and is empty
1614+
if (filter.and.length === 0) {
1615+
delete filter.and
1616+
}
16131617
}
16141618

16151619
if (segmentId) {
@@ -1635,8 +1639,6 @@ class OrganizationRepository {
16351639
tenantId: options.currentTenant.id,
16361640
}
16371641

1638-
options.log.info('params', params)
1639-
16401642
const filterString = RawQueryParser.parseFilters(
16411643
filter,
16421644
OrganizationRepository.QUERY_FILTER_COLUMN_MAP,

0 commit comments

Comments
 (0)