Skip to content

Commit

Permalink
fix(application-system): Fix post-cleanup codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
norda-gunni committed Dec 19, 2024
1 parent 15edb19 commit c3799e0
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { AccidentNotificationConfirmation } from '@island.is/api/schema'
import { getValueViaPath } from '@island.is/application/core'
import { FormValue, YES } from '@island.is/application/types'
import { isReportingOnBehalfOfEmployee as isReportingOnBehalfOfEmployeeOrginal } from './reportingUtils'
Expand Down Expand Up @@ -28,10 +27,14 @@ export const formatPhonenumber = (value: string) => {
}

export const hasReceivedConfirmation = (answers: FormValue) => {
// The fetched value is actually typed as AccidentNotificationConfirmation, but importing that type breaks when codegen is run after cleanup
const accidentConfirmations = getValueViaPath(
answers,
'accidentStatus.receivedConfirmations',
) as AccidentNotificationConfirmation
) as {
InjuredOrRepresentativeParty: boolean | undefined
CompanyParty: boolean | undefined
}

// if juridical person then the injured or the power of attorney holder has to confirm
if (isReportingOnBehalfOfEmployee(answers)) {
Expand Down

0 comments on commit c3799e0

Please sign in to comment.