Skip to content

Commit

Permalink
fix: fixed logic in disable filter
Browse files Browse the repository at this point in the history
  • Loading branch information
mheggelund committed Jan 4, 2024
1 parent e73a8c9 commit b4e5e21
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ export const ModelAreaSelect = ({
caseError: string;
}) => {
const filterDisabled = (option: ModelAreaDto) => {
if (!existingCases || existingCases.length === 0 || !option.modelAreaId)
if (existingCases.length === 0) {
return false;
} else if (
!option.modelAreaId &&
existingCases.find((c) => c.modelArea === null)
) {
return true;
}

const caseExists = existingCases
.filter((c) => c.modelArea !== null)
Expand Down

0 comments on commit b4e5e21

Please sign in to comment.