Skip to content

Commit

Permalink
Merge pull request #219 from wafflestudio/feature/lecture-building-up…
Browse files Browse the repository at this point in the history
…date

강의 업데이트 시 강의동 정보가 날아가지 않도록 수정
  • Loading branch information
subeenpark-io authored Feb 3, 2024
2 parents 877d0e4 + 013aada commit 51aad96
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,21 @@ class TimetableLectureServiceImpl(
remark = modifyTimetableLectureRequestDto.remark ?: remark
color = modifyTimetableLectureRequestDto.color ?: color
colorIndex = modifyTimetableLectureRequestDto.colorIndex ?: colorIndex
classPlaceAndTimes = modifyTimetableLectureRequestDto.classPlaceAndTimes?.map { it.toClassPlaceAndTime() } ?: classPlaceAndTimes
classPlaceAndTimes = modifyTimetableLectureRequestDto.classPlaceAndTimes?.map {
it.toClassPlaceAndTime()
} ?: classPlaceAndTimes
}.apply {
val lecture = timetableLecture.lectureId?.let { lectureRepository.findById(it) }

classPlaceAndTimes = classPlaceAndTimes.mapIndexed { index, classPlaceAndTime ->
classPlaceAndTime.apply {
this.lectureBuildings = lecture?.classPlaceAndTimes?.getOrNull(index)?.lectureBuildings
}
}
}

resolveTimeConflict(timetable, timetableLecture, isForced)

return timetableRepository.updateTimetableLecture(timetableId, timetableLecture)
}

Expand Down

0 comments on commit 51aad96

Please sign in to comment.