Skip to content

Commit

Permalink
fix(citizenship): error with given and family names on prod (#15865)
Browse files Browse the repository at this point in the history
* fixed name error and prune date for draft

* fixed name error and prune date for draft

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
berglindoma13 and kodiakhq[bot] authored Sep 3, 2024
1 parent 2ff3afd commit 9a67d75
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,11 @@ export class CitizenshipService extends BaseTemplateApiService {
}
}) || [],
isFormerIcelandicCitizen: answers.formerIcelander === YES,
givenName: individual?.givenName,
familyName: individual?.familyName,
givenName:
individual?.givenName ||
individual?.fullName.split(' ').slice(0, -1).join(' '), //if given name is not available then remove last name and return the rest of the name as the given name
familyName:
individual?.familyName || individual?.fullName.split(' ').pop(),
fullName: individual?.fullName,
address: individual?.address?.streetAddress,
postalCode: individual?.address?.postalCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const UserInformationSubSection = buildSubSection({
undefined,
) as NationalRegistryIndividual | undefined

return `${individual?.givenName} ${individual?.familyName}`
return individual?.fullName
},
}),
buildTextField({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const template: ApplicationTemplate<
},
],
},
lifecycle: pruneAfterDays(1),
lifecycle: pruneAfterDays(30),
onExit: defineTemplateApi({
action: ApiActions.validateApplication,
}),
Expand Down

0 comments on commit 9a67d75

Please sign in to comment.