Thanks to visit codestin.com
Credit goes to github.com

Skip to content

myorg endpoint #1777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public interface OrganizationRepository extends ReactiveMongoRepository<Organiza

Flux<Organization> findByOrganizationDomainIsNotNull();
Mono<Boolean> existsBySlug(String slug);

Flux<Organization> findByIdInAndNameContainingIgnoreCase(List<String> ids, String name, Pageable pageable);
Mono<Long> countByIdInAndNameContainingIgnoreCase(List<String> ids, String name);
Flux<Organization> findByIdInAndNameContainingIgnoreCaseAndState(List<String> ids, String name, OrganizationState state, Pageable pageable);
Mono<Long> countByIdInAndNameContainingIgnoreCaseAndState(List<String> ids, String name, OrganizationState state);
}
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public Flux<Organization> findUserOrgs(String userId, String orgName, Pageable p
if (orgIds.isEmpty()) {
return Flux.empty();
}
return repository.findByIdInAndNameContainingIgnoreCase(orgIds, orgName, pageable);
return repository.findByIdInAndNameContainingIgnoreCaseAndState(orgIds, orgName, ACTIVE, pageable);
});
}

Expand All @@ -344,7 +344,7 @@ public Mono<Long> countUserOrgs(String userId, String orgName) {
if (orgIds.isEmpty()) {
return Mono.just(0L);
}
return repository.countByIdInAndNameContainingIgnoreCase(orgIds, filter);
return repository.countByIdInAndNameContainingIgnoreCaseAndState(orgIds, filter, ACTIVE);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.lowcoder.sdk.config.CommonConfig;
import org.lowcoder.sdk.constants.AuthSourceConstants;
import org.lowcoder.sdk.exception.BizError;
import org.springframework.data.domain.Sort;
import org.springframework.http.HttpStatus;
import org.springframework.http.codec.multipart.Part;
import org.springframework.web.bind.annotation.*;
Expand Down Expand Up @@ -80,7 +81,7 @@ public Mono<ResponseView<?>> getUserOrgs(ServerWebExchange exchange,
@RequestParam(required = false, defaultValue = "10") Integer pageSize) {
return sessionUserService.getVisitor()
.flatMap(user -> {
Pageable pageable = PageRequest.of(pageNum - 1, pageSize);
Pageable pageable = PageRequest.of(pageNum - 1, pageSize, Sort.by(Sort.Direction.DESC, "updatedAt"));
String filter = orgName == null ? "" : orgName;
return organizationService.findUserOrgs(user.getId(), filter, pageable)
.map(OrgView::new)
Expand Down
Loading