Skip to content

Commit

Permalink
fix: 현재 모임질문 조회 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
nahyeon99 committed Aug 13, 2024
1 parent 9ed660e commit 3456681
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ public Optional<MeetingQuestion> findMeetingQuestion(Long meetingId) {
return Optional.ofNullable(
queryFactory
.selectFrom(meetingQuestion)
.where(meetingQuestion.meeting.id.eq(meetingId))
.where(meetingQuestion.meeting.id.eq(meetingId),
registeredOrActiveCond())
.orderBy(meetingQuestion.startTime.asc())
.limit(1)
.fetchOne()
Expand Down Expand Up @@ -171,6 +172,12 @@ private Boolean isAnswered(Long meetingQuestionId, Long meetingMemberId) {
return fetchOne != null;
}

private BooleanExpression registeredOrActiveCond() {
LocalDateTime now = LocalDateTime.now();
return meetingQuestion.startTime.loe(now)
.and(meetingQuestion.startTime.goe(now.minusHours(RESPONSE_TIME_LIMIT_HOURS)));
}

private BooleanExpression registeredCond() {
LocalDateTime now = LocalDateTime.now();
return meetingQuestion.startTime.loe(now)
Expand Down

0 comments on commit 3456681

Please sign in to comment.