Skip to content

Commit

Permalink
fix: send default paySubsidyPercent value (HL-995) (#2311)
Browse files Browse the repository at this point in the history
* fix: send default paySubsidyPercent value on handler side

* fix: send default paySubsidyPercent value on applicant side
  • Loading branch information
mjturt authored Oct 3, 2023
1 parent 102fecb commit c6c1abc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion frontend/benefit/applicant/src/hooks/useFormActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
getApplicationStepFromString,
getApplicationStepString,
} from 'benefit/applicant/utils/common';
import { BENEFIT_TYPES } from 'benefit-shared/constants';
import { BENEFIT_TYPES, PAY_SUBSIDY_OPTIONS } from 'benefit-shared/constants';
import {
Application,
ApplicationData,
Expand Down Expand Up @@ -115,6 +115,7 @@ const useFormActions = (application: Partial<Application>): FormActions => {
const normalizedValues = {
...currentValues,
employee,
paySubsidyPercent: PAY_SUBSIDY_OPTIONS[0],
startDate: currentValues.startDate
? convertToBackendDateFormat(parseDate(currentValues.startDate))
: undefined,
Expand Down
7 changes: 6 additions & 1 deletion frontend/benefit/handler/src/hooks/useFormActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { APPLICATION_FIELD_KEYS } from 'benefit/handler/constants';
import DeMinimisContext from 'benefit/handler/context/DeMinimisContext';
import { StepActionType } from 'benefit/handler/hooks/useSteps';
import { Application } from 'benefit/handler/types/application';
import { APPLICATION_STATUSES, BENEFIT_TYPES } from 'benefit-shared/constants';
import {
APPLICATION_STATUSES,
BENEFIT_TYPES,
PAY_SUBSIDY_OPTIONS,
} from 'benefit-shared/constants';
import { ApplicationData, Employee } from 'benefit-shared/types/application';
import camelcaseKeys from 'camelcase-keys';
import { useRouter } from 'next/router';
Expand Down Expand Up @@ -140,6 +144,7 @@ const useFormActions = (application: Partial<Application>): FormActions => {

const normalizedValues = {
...currentValues,
paySubsidyPercent: PAY_SUBSIDY_OPTIONS[0],
employee: employee || {},
startDate: currentValues.startDate
? convertToBackendDateFormat(parseDate(currentValues.startDate))
Expand Down

0 comments on commit c6c1abc

Please sign in to comment.