Skip to content

Commit

Permalink
Fix Location Type payload and PidNumber refactor (#1722)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimak1 authored Feb 5, 2024
1 parent ab5f809 commit 0dcc0ce
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 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.0.34",
"version": "3.0.35",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
10 changes: 4 additions & 6 deletions ppr-ui/src/components/common/PidNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,12 @@
<script lang="ts">
import { computed, defineComponent, nextTick, reactive, ref, toRefs, watch } from 'vue'
import { useStore } from '@/store/store'
import { useInputRules } from '@/composables'
import { ltsaDetails } from '@/utils/ltsa-api-helper'
import { BaseDialog } from '@/components/dialogs'
import { pidNotFoundDialog } from '@/resources/dialogOptions'
import { LtsaDetailsIF, PidInfoIF } from '@/interfaces/ltsa-api-interfaces'
import { FormIF } from '@/interfaces'
import { storeToRefs } from 'pinia'
export default defineComponent({
Expand All @@ -120,21 +118,21 @@ export default defineComponent({
BaseDialog
},
props: {
pidNumber: { type: String, default: '' },
disable: { type: Boolean, default: false },
required: { type: Boolean, default: false }
},
emits: ['setPid', 'verifyingPid'],
setup (props, context) {
const { getMhrRegistrationLocation } = storeToRefs(useStore())
const { isNumber } = useInputRules()
const pidOneRef = ref(null) as FormIF
const pidTwoRef = ref(null) as FormIF
const pidThreeRef = ref(null) as FormIF
const localState = reactive({
pidOne: getMhrRegistrationLocation.value?.pidNumber.slice(0, 3) || '',
pidTwo: getMhrRegistrationLocation.value?.pidNumber.slice(3, 6) || '',
pidThree: getMhrRegistrationLocation.value?.pidNumber.slice(6, 9) || '',
pidOne: props.pidNumber?.slice(0, 3) || '',
pidTwo: props.pidNumber?.slice(3, 6) || '',
pidThree: props.pidNumber?.slice(6, 9) || '',
enablePidLoader: false,
dialogOptions: pidNotFoundDialog,
showNotFoundDialog: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
>
<PidNumber
class="mb-4"
:pidNumber="locationTypeInfo.pidNumber"
:disable="showLocationInfo"
:required="otherTypeOption === HomeLocationTypes.OTHER_STRATA && validate"
@set-pid="handlePidInfo($event)"
Expand Down
6 changes: 6 additions & 0 deletions ppr-ui/src/composables/mhrInformation/useTransportPermits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ export const useTransportPermits = () => {
payloadData.newLocation.address.postalCode = ' '
}

// api does not support otherType, and it should be set to the locationType
if (payloadData.newLocation.otherType) {
payloadData.newLocation.locationType = payloadData.newLocation.otherType
delete payloadData.newLocation.otherType
}

return payloadData
}

Expand Down

0 comments on commit 0dcc0ce

Please sign in to comment.