Skip to content

Commit

Permalink
Format Submitting Party Phone Number (#1474)
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-eyds authored Aug 8, 2023
1 parent 45d715f commit a4cabbf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ppr-ui/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 ppr-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ppr-ui",
"version": "2.0.42",
"version": "2.0.43",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
15 changes: 13 additions & 2 deletions ppr-ui/src/composables/mhrRegistration/useNewMhrRegistration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ import {
} from '@/interfaces'
import { StaffPaymentIF } from '@bcrs-shared-components/interfaces'
import { APIMhrTypes, HomeTenancyTypes, HomeLocationTypes, MhApiStatusTypes, HomeCertificationOptions } from '@/enums'
import { createMhrDraft, getMhrDrafts, getMhrManufacturerInfo, mhrRegistrationHistory, updateMhrDraft } from '@/utils'
import {
createMhrDraft,
fromDisplayPhone,
getMhrDrafts,
getMhrManufacturerInfo,
mhrRegistrationHistory,
updateMhrDraft
} from '@/utils'
import { orderBy } from 'lodash'
import { useHomeOwners } from '@/composables'

Expand Down Expand Up @@ -207,11 +214,15 @@ export const useNewMhrRegistration = () => {
}

const parseSubmittingParty = () => {
const submittingParty = cleanEmpty(getMhrRegistrationSubmittingParty.value)
let submittingParty = cleanEmpty(getMhrRegistrationSubmittingParty.value)

if (submittingParty.businessName) {
delete submittingParty.personName
}
// Format phone numbers to digits only for submission
if (submittingParty.phoneNumber) {
submittingParty = { ...submittingParty, phoneNumber: fromDisplayPhone(submittingParty.phoneNumber) }
}

return submittingParty
}
Expand Down

0 comments on commit a4cabbf

Please sign in to comment.