Skip to content

Commit

Permalink
[COT-126] Hotfix: 출결 단건 조회 시 세션 타이틀 추가 (#256)
Browse files Browse the repository at this point in the history
* feat: 출석 단건 조회 시 세션 타이틀 필드 추가

* hotfix: 출석에 해당하는 세션을 조회할 때 잘못된 id를 조회
  • Loading branch information
Youthhing committed Dec 27, 2024
1 parent c6e468a commit 1adbd94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public record AttendanceResponse(
Location location,
@Schema(description = "세션 PK", requiredMode = RequiredMode.REQUIRED)
Long sessionId,
@Schema(description = "세션 타이틀", requiredMode = RequiredMode.REQUIRED)
String sessionTitle,
@Schema(description = "출결 옵션", requiredMode = RequiredMode.REQUIRED)
SessionType sessionType,
@Schema(description = "출석 오픈 상태", requiredMode = RequiredMode.REQUIRED)
Expand All @@ -33,6 +35,7 @@ public static AttendanceResponse of(Attendance attendance, Session session) {
attendance.getLateDeadLine(),
attendance.getLocation(),
attendance.getSessionId(),
session.getTitle(),
session.getSessionType(),
AttendanceUtil.getAttendanceOpenStatus(session.getSessionDateTime(), attendance, LocalDateTime.now())
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class AttendanceService {

public AttendanceResponse getAttendance(final Long attendanceId) {
Attendance attendance = attendanceReader.findById(attendanceId);
Session session = sessionReader.findById(attendanceId);
Session session = sessionReader.findById(attendance.getSessionId());
return AttendanceResponse.of(attendance, session);
}

Expand Down

0 comments on commit 1adbd94

Please sign in to comment.