Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
refactor :: UserAdapter.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed May 10, 2024
1 parent cab506d commit d2acd23
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public Flux<User> findAllByGenAndMajorAndClub(FindUserDto request) {
if ((sortBy != null && !sortBy.isBlank())) {
var sortDirection = request.pagingInfo().sortDirection();
if (sortDirection != null && sortDirection.equals(1)) {
query.with(Sort.by(Sort.Direction.ASC, sortBy));
query.with(sortBy(Sort.Direction.ASC, sortBy));
} else {
query.with(Sort.by(Sort.Direction.DESC, sortBy));
query.with(sortBy(Sort.Direction.DESC, sortBy));
}
}

Expand All @@ -80,6 +80,10 @@ public Flux<User> findAllByGenAndMajorAndClub(FindUserDto request) {
.subscribeOn(Schedulers.boundedElastic());
}

private Sort sortBy(Sort.Direction direction, String sortBy) {
return Sort.by(direction, sortBy);
}

@Override
public Mono<User> save(User user) {
return userRepository.save(user);
Expand Down

0 comments on commit d2acd23

Please sign in to comment.