Skip to content

Commit

Permalink
Fix relation fields not being dirty on update
Browse files Browse the repository at this point in the history
  • Loading branch information
akmatoff committed Apr 29, 2024
1 parent e48cc15 commit 561a36f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/pages/lectures/LectureDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function LectureDetails() {
options={topicOptions}
activeValue={activeValue}
setActiveValue={(value) => {
lectureForm.setValue("topicId", +value.value);
lectureForm.setValue("topicId", +value.value, { shouldDirty: true });
setActiveValue(value);
}}
label="Топик"
Expand Down
4 changes: 3 additions & 1 deletion src/pages/sections/SectionDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ function SectionDetails() {
options={subjectOptions}
activeValue={activeValue}
setActiveValue={(value) => {
sectionForm.setValue("subjectId", +value.value);
sectionForm.setValue("subjectId", +value.value, {
shouldDirty: true,
});
setActiveValue(value);
}}
label="Предмет"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/tasks/TaskDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function TaskDetails() {
options={topicOptions}
activeValue={activeValue}
setActiveValue={(value) => {
taskForm.setValue("topicId", +value.value);
taskForm.setValue("topicId", +value.value, { shouldDirty: true });
setActiveValue(value);
}}
label="Топик"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/topics/TopicDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function TopicDetails() {
options={sectionOptions}
activeValue={activeValue}
setActiveValue={(value) => {
topicForm.setValue("sectionId", +value.value);
topicForm.setValue("sectionId", +value.value, { shouldDirty: true });
setActiveValue(value);
}}
label="Раздел"
Expand Down

0 comments on commit 561a36f

Please sign in to comment.