From b7be2613ba4e74b200c377b902d4bcad8e31a807 Mon Sep 17 00:00:00 2001 From: shane Date: Sun, 28 Jan 2024 21:34:18 +0900 Subject: [PATCH] Fix: Persist manager update in department to database This commit resolves the issue where changes to the department's manager were not being persisted to the database. Adjustments were made to ensure that the Department entity is properly managed within the transactional scope of the changeManager method. --- .../shanepark/dutypark/department/service/DepartmentService.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/tistory/shanepark/dutypark/department/service/DepartmentService.kt b/src/main/kotlin/com/tistory/shanepark/dutypark/department/service/DepartmentService.kt index 30e06908..d546f142 100644 --- a/src/main/kotlin/com/tistory/shanepark/dutypark/department/service/DepartmentService.kt +++ b/src/main/kotlin/com/tistory/shanepark/dutypark/department/service/DepartmentService.kt @@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional class DepartmentService( private val repository: DepartmentRepository, private val dutyRepository: DutyRepository, + private val departmentRepository: DepartmentRepository ) { @Transactional(readOnly = true) @@ -87,7 +88,7 @@ class DepartmentService( fun changeManager(department: Department, member: Member?) { department.changeManager(member) + departmentRepository.save(department) } - }