Skip to content

Commit

Permalink
Bug fix for pre-set declared value (#1819)
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-eyds authored Apr 9, 2024
1 parent ab6b896 commit b678fd1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ppr-ui/src/composables/mhrInformation/useMhrInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,22 @@ export const useMhrInformation = () => {
return ownerGroups
}

/**
* Builds the API data payload for a manufactured home transfer filing.
* @param {boolean} [isDraft=false] - Indicates whether the filing is a draft.
* @returns {Promise<MhrTransferApiIF>} The API data payload for the manufactured home transfer.
*/
const buildApiData = async (isDraft: boolean = false): Promise<MhrTransferApiIF> => {
// Handles instances where declared value is a set number and readonly (ex SoG flow following an Affe filing)
// When string captured by UI: cast to integer and remove commas if they exist
const declaredValue = (typeof getMhrTransferDeclaredValue.value === 'string')
? parseInt(getMhrTransferDeclaredValue.value?.replace(/,/g, ''))
: getMhrTransferDeclaredValue.value

const data: MhrTransferApiIF = {
draftNumber: getMhrInformation.value.draftNumber,
mhrNumber: getMhrInformation.value.mhrNumber,
declaredValue: parseInt(getMhrTransferDeclaredValue.value?.replace(/,/g, '')), // Cast to Int and remove commas
declaredValue: declaredValue,
consideration: getMhrTransferConsideration.value,
transferDate: getMhrTransferDate.value,
ownLand: getMhrTransferOwnLand.value,
Expand Down

0 comments on commit b678fd1

Please sign in to comment.