Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

19774 Fixed null officer email schema error #651

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-create-ui",
"version": "5.8.10",
"version": "5.8.11",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand Down
5 changes: 3 additions & 2 deletions src/mixins/filing-template-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1468,14 +1468,15 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM
}

/**
* Fixes addresses by deleting the type in case it was null.
* Fixes addresses by deleting the type in case it is null. Also fixes null officer email.
* @param orgPeople The array of orgs/people
* @returns the array of orgs/people after addresses been fixed
* @returns the array of orgs/people with fixed address types and email
*/
fixNullAddressType (orgPeople: OrgPersonIF[]): OrgPersonIF[] {
return orgPeople.map(p => {
if (p.deliveryAddress?.addressType === null) delete p.deliveryAddress.addressType
if (p.mailingAddress?.addressType === null) delete p.mailingAddress.addressType
if (p.officer?.email === null) delete p.officer.email
Copy link
Collaborator Author

@severinbeauvais severinbeauvais Feb 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Party schema shows this:

image

JSON schema reference shows this (so I don't have to delete email if it's an empty string):

image

return p
})
}
Expand Down
Loading