#99 fix update subject name after edit

This commit is contained in:
brreynie 2023-05-10 16:43:14 +02:00
parent de25ed85b5
commit a7752e5706

View file

@ -75,11 +75,13 @@ class SubjectEditFormViewModel @Inject constructor(
} }
fun onEdit(openAndPopUp: (String, String) -> Unit) { fun onEdit(openAndPopUp: (String, String) -> Unit) {
val newSubject = selectedSubject().copy( selectedSubject.set(
name = name, selectedSubject().copy(
argb_color = color, name = name,
argb_color = color,
)
) )
subjectDAO.updateSubject(newSubject) subjectDAO.updateSubject(selectedSubject())
openAndPopUp(StudeezDestinations.TASKS_SCREEN, StudeezDestinations.EDIT_SUBJECT_FORM) openAndPopUp(StudeezDestinations.TASKS_SCREEN, StudeezDestinations.EDIT_SUBJECT_FORM)
} }
} }