Skip to content

Commit 5015a71

Browse files
committed
Filter orgs to return only those with an active state.
1 parent 1889d6c commit 5015a71

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

server/api-service/lowcoder-domain/src/main/java/org/lowcoder/domain/organization/repository/OrganizationRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public interface OrganizationRepository extends ReactiveMongoRepository<Organiza
3434
Flux<Organization> findByOrganizationDomainIsNotNull();
3535
Mono<Boolean> existsBySlug(String slug);
3636

37-
Flux<Organization> findByIdInAndNameContainingIgnoreCase(List<String> ids, String name, Pageable pageable);
38-
Mono<Long> countByIdInAndNameContainingIgnoreCase(List<String> ids, String name);
37+
Flux<Organization> findByIdInAndNameContainingIgnoreCaseAndState(List<String> ids, String name, OrganizationState state, Pageable pageable);
38+
Mono<Long> countByIdInAndNameContainingIgnoreCaseAndState(List<String> ids, String name, OrganizationState state);
3939
}

server/api-service/lowcoder-domain/src/main/java/org/lowcoder/domain/organization/service/OrganizationServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ public Flux<Organization> findUserOrgs(String userId, String orgName, Pageable p
330330
if (orgIds.isEmpty()) {
331331
return Flux.empty();
332332
}
333-
return repository.findByIdInAndNameContainingIgnoreCase(orgIds, orgName, pageable);
333+
return repository.findByIdInAndNameContainingIgnoreCaseAndState(orgIds, orgName, ACTIVE, pageable);
334334
});
335335
}
336336

@@ -344,7 +344,7 @@ public Mono<Long> countUserOrgs(String userId, String orgName) {
344344
if (orgIds.isEmpty()) {
345345
return Mono.just(0L);
346346
}
347-
return repository.countByIdInAndNameContainingIgnoreCase(orgIds, filter);
347+
return repository.countByIdInAndNameContainingIgnoreCaseAndState(orgIds, filter, ACTIVE);
348348
});
349349
}
350350
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy