Skip to content

Commit

Permalink
Fix error caused when category is cleared (#2205)
Browse files Browse the repository at this point in the history
  • Loading branch information
ipasic-softserve authored Aug 2, 2024
1 parent 702daaa commit 42c26ce
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 42c26ce

Please sign in to comment.