From a4cabbfef567bcc8eadf701ba74cf2091dad00a3 Mon Sep 17 00:00:00 2001 From: CameronEYDS <53542131+cameron-eyds@users.noreply.github.com> Date: Tue, 8 Aug 2023 12:17:44 -0700 Subject: [PATCH] Format Submitting Party Phone Number (#1474) --- ppr-ui/package-lock.json | 4 ++-- ppr-ui/package.json | 2 +- .../mhrRegistration/useNewMhrRegistration.ts | 15 +++++++++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ppr-ui/package-lock.json b/ppr-ui/package-lock.json index e93e46a1d..3ca2d641b 100644 --- a/ppr-ui/package-lock.json +++ b/ppr-ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "ppr-ui", - "version": "2.0.42", + "version": "2.0.43", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ppr-ui", - "version": "2.0.42", + "version": "2.0.43", "dependencies": { "@bcrs-shared-components/corp-type-module": "^1.0.7", "@bcrs-shared-components/enums": "^1.0.19", diff --git a/ppr-ui/package.json b/ppr-ui/package.json index d99af8c51..5780dfaff 100644 --- a/ppr-ui/package.json +++ b/ppr-ui/package.json @@ -1,6 +1,6 @@ { "name": "ppr-ui", - "version": "2.0.42", + "version": "2.0.43", "private": true, "appName": "Assets UI", "sbcName": "SBC Common Components", diff --git a/ppr-ui/src/composables/mhrRegistration/useNewMhrRegistration.ts b/ppr-ui/src/composables/mhrRegistration/useNewMhrRegistration.ts index 27590484a..848d87544 100644 --- a/ppr-ui/src/composables/mhrRegistration/useNewMhrRegistration.ts +++ b/ppr-ui/src/composables/mhrRegistration/useNewMhrRegistration.ts @@ -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' @@ -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 }