Skip to content

Commit

Permalink
[refactor] #157 delete unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
chaewonni committed Feb 3, 2025
1 parent bef10e3 commit d2a62a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,6 @@ public PromisesDto getPromises(
final Boolean done,
final Boolean isParticipant
) {
// List<Promise> allPromises = promiseRetriever.findAllByMeetingId(meetingId);
// List<Promise> userPromises = promiseRetriever.findPromiseByUserIdAndMeetingId(userId, meetingId);
// List<Promise> promises;
//
// if (Boolean.TRUE.equals(isParticipant)) {
// promises = userPromises;
// } else if (Boolean.FALSE.equals(isParticipant)) {
// promises = allPromises.stream()
// .filter(promise -> !userPromises.contains(promise))
// .collect(Collectors.toList());
// } else {
// promises = allPromises;
// }

List<Promise> promises = promiseRetriever.findPromisesByConditions(userId, meetingId, done, isParticipant);

return PromisesDto.of(promises);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class PromiseRepositoryCustomImpl implements PromiseRepositoryCustom {
public List<Promise> findPromiseByConditions(Long userId, Long meetingId, Boolean done, Boolean isParticipant) {
return queryFactory
.selectFrom(promise)
.join(promise.participants, participant).fetchJoin()
.join(participant.member, member).fetchJoin()
.leftJoin(promise.participants, participant).fetchJoin()
.leftJoin(participant.member, member).fetchJoin()
.where(
meetingIdEq(meetingId),
isParticipantEq(userId, meetingId, isParticipant),
Expand Down

0 comments on commit d2a62a4

Please sign in to comment.