Skip to content

Commit

Permalink
Fix: Persist manager update in department to database
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ShanePark committed Jan 28, 2024
1 parent 5fdea7e commit b7be261
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -87,7 +88,7 @@ class DepartmentService(

fun changeManager(department: Department, member: Member?) {
department.changeManager(member)
departmentRepository.save(department)
}


}

0 comments on commit b7be261

Please sign in to comment.