Skip to content

Commit

Permalink
fix(estate): bug fix (#15254)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
albinagu and kodiakhq[bot] authored Jun 18, 2024
1 parent 69343fe commit eb70c65
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export const AdditionalEstateMember = ({
options={relationOptions}
error={error?.relation}
backgroundColor="blue"
required
required={!field.initial}
/>
</GridColumn>
{application.answers.selectedEstate ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,29 +413,31 @@ const RealEstateNumberField = ({
}, [queryLoading])

useEffect(() => {
const propertyNumber = propertyNumberInput
.trim()
.toUpperCase()
.replace('-', '')
if (!props.readOnly) {
const propertyNumber = propertyNumberInput
.trim()
.toUpperCase()
.replace('-', '')

setValue(descriptionFieldName, '')
setValue(descriptionFieldName, '')

if (isValidRealEstate(propertyNumber)) {
clearErrors(fieldName)
if (isValidRealEstate(propertyNumber)) {
clearErrors(fieldName)

getProperty({
variables: {
input: {
propertyNumber,
getProperty({
variables: {
input: {
propertyNumber,
},
},
},
})
} else {
if (propertyNumber.length !== 0) {
setError(fieldName, {
message: formatMessage(m.errorPropertyNumber),
type: 'validate',
})
} else {
if (propertyNumber.length !== 0) {
setError(fieldName, {
message: formatMessage(m.errorPropertyNumber),
type: 'validate',
})
}
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ export const currencyStringToNumber = (str: string) => {
return parseInt(cleanString, 10)
}

export const isValidString = (string: string | undefined) =>
string && /\S/.test(string)
export const isValidString = (string: string | undefined) => {
return string && /\S/.test(string)
}

export const getEstateDataFromApplication = (
application: Application<FormValue>,
Expand Down

0 comments on commit eb70c65

Please sign in to comment.