Skip to content

Commit 6889111

Browse files
authored
Merge pull request #280 from pirogramming/backend_sj
[fix] deposit update
2 parents b9ae6f4 + aec638e commit 6889111

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

backend/pirocheck/src/main/java/backend/pirocheck/Attendance/service/AttendanceService.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,14 @@ public boolean deleteAttendance(Long attendanceId) {
297297
if (attendanceOpt.isEmpty()) {
298298
return false;
299299
}
300-
301-
attendanceRepository.delete(attendanceOpt.get());
300+
301+
Attendance attendance = attendanceOpt.get(); // 변수로 저장
302+
Long userId = attendance.getUser().getId();
303+
304+
attendanceRepository.delete(attendance);
305+
306+
// 출석 삭제 후 보증금 재계산
307+
depositService.recalculateDeposit(userId);
302308
return true;
303309
}
304310

0 commit comments

Comments
 (0)