Skip to content

Commit

Permalink
chore: remove old comission-based effect
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtawast committed Apr 3, 2024
1 parent e3b26b4 commit 0777ba6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ const ApplicationFormStep2: React.FC<DynamicFormStepComponentProps> = ({

useDependentFieldsEffect(
{
apprenticeshipProgram: formik.values.apprenticeshipProgram,
benefitType: formik.values.benefitType,
paySubsidyGranted: formik.values.paySubsidyGranted,
associationHasBusinessActivities:
formik.values.associationHasBusinessActivities,
Expand Down
13 changes: 1 addition & 12 deletions frontend/benefit/applicant/src/hooks/useDependentFieldsEffect.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { BENEFIT_TYPES, PAY_SUBSIDY_GRANTED } from 'benefit-shared/constants';
import { PAY_SUBSIDY_GRANTED } from 'benefit-shared/constants';
import React from 'react';

interface FieldValues {
useAlternativeAddress?: boolean | null;
apprenticeshipProgram?: boolean | null;
benefitType?: BENEFIT_TYPES | '';
paySubsidyGranted?: PAY_SUBSIDY_GRANTED | null;
associationHasBusinessActivities?: boolean | null;
startDate?: string;
Expand Down Expand Up @@ -46,8 +44,6 @@ type State = EFFECTS[];
export const useDependentFieldsEffect = (
{
useAlternativeAddress,
apprenticeshipProgram,
benefitType,
paySubsidyGranted,
associationHasBusinessActivities,
startDate,
Expand Down Expand Up @@ -119,13 +115,6 @@ export const useDependentFieldsEffect = (
}
}, [paySubsidyGranted]);

// Effects when apprenticeshipProgram changes
React.useEffect(() => {
if (benefitType === BENEFIT_TYPES.COMMISSION && apprenticeshipProgram) {
dispatch(createUpdateAction([EFFECTS.CLEAR_BENEFIT_VALUES]));
}
}, [apprenticeshipProgram, benefitType]);

// Effects when associationHasBusinessActivities changes
React.useEffect(() => {
if (associationHasBusinessActivities === false) {
Expand Down

0 comments on commit 0777ba6

Please sign in to comment.