Skip to content

Commit

Permalink
Update Cancel Transport Permit payload (#1891)
Browse files Browse the repository at this point in the history
* Fix SubmittingParty in Cancel Permit payload
  • Loading branch information
dimak1 authored May 22, 2024
1 parent a196a65 commit 901768d
Show file tree
Hide file tree
Showing 3 changed files with 11 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": "3.1.31",
"version": "3.1.32",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
10 changes: 8 additions & 2 deletions ppr-ui/src/composables/mhrRegistration/useMhrCorrections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
MhRegistrationSummaryIF,
NewMhrRegistrationApiIF,
RegistrationTypeIF,
SubmittingPartyIF,
UpdatedBadgeIF
} from '@/interfaces'
import { cloneDeep, omit } from 'lodash'
Expand All @@ -39,6 +40,7 @@ export const useMhrCorrections = () => {
getMhrHomeSections,
isRoleStaffReg,
getMhrTransportPermit,
getMhrAccountSubmittingParty,
getMhrTransportPermitPreviousLocation,
getMhrRegistrationOwnLand,
getMhrRegistrationLocation,
Expand Down Expand Up @@ -359,14 +361,18 @@ export const useMhrCorrections = () => {

const isCancelTransportPermit = useTransportPermits().isCancelChangeLocationActive.value

const submittingParty: SubmittingPartyIF = isRoleStaffReg.value
? getMhrTransportPermit.value.submittingParty
: getMhrAccountSubmittingParty.value

const payloadData: AdminRegistrationIF = {
documentType: isCancelTransportPermit
? APIRegistrationTypes.TRANSPORT_PERMIT_CANCEL
: APIRegistrationTypes.REGISTERED_LOCATION_CHANGE,
documentId: getMhrTransportPermit.value.documentId,
submittingParty: {
...getMhrTransportPermit.value.submittingParty,
phoneNumber: fromDisplayPhone(getMhrTransportPermit.value.submittingParty?.phoneNumber)
...submittingParty,
phoneNumber: fromDisplayPhone(submittingParty?.phoneNumber)
},
location: isCancelTransportPermit
? { ...getMhrTransportPermitPreviousLocation.value }
Expand Down

0 comments on commit 901768d

Please sign in to comment.