Skip to content

Commit

Permalink
Fix error caused when category is cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
ipasic-softserve committed Jul 29, 2024
1 parent 6635ed4 commit 90febf4
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ const AddProfessionalCategoryModal: FC<AddProfessionalCategoryModalProps> = ({
_: SyntheticEvent,
value: CategoryNameInterface | null
) => {
if (!value) {
handleDataChange({
category: { _id: '', name: '' },
subjects: [{ _id: '', name: '' }]
})
return
}
handleDataChange({ category: value, professionalSubjectTemplate })
}

Expand Down

0 comments on commit 90febf4

Please sign in to comment.