Skip to content

Commit

Permalink
chore(condo): DOMA-8419 stop comparing addresses (#4379)
Browse files Browse the repository at this point in the history
Also, improved logs for address service plugin
  • Loading branch information
AleX83Xpert authored Feb 12, 2024
1 parent d18e304 commit 14233ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions apps/condo/domains/property/hooks/useImporterFunctions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ export const useImporterFunctions = (): [Columns, RowNormalizer, RowValidator, O
const [address] = row
const suggestions = await addressApi.getSuggestions(String(address.value))

let suggestion = get(suggestions, ['suggestions', 0], null)
if (get(suggestion, 'value') !== get(address, 'value')) suggestion = null
const suggestion = get(suggestions, ['suggestions', 0], null)

const suggestionType = get(suggestion, 'type')
const houseTypeFull = get(suggestion, ['data', 'house_type_full'])
Expand Down
6 changes: 3 additions & 3 deletions packages/keystone/plugins/addressService.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,16 @@ const addressService = ({
addressFields['addressKey'] = get(result, 'addressKey')
addressFields['addressSources'] = get(result, 'addressSources', [])
} else {
const msg = `No address found by string "${addressToSearch}"`
logger.error({
msg,
msg: 'No address found by string',
addressToSearch,
operation,
listKey,
itemId: get(existingItem, 'id'),
addressKey: get(existingItem, 'addressKey'),
})

throw new Error(msg)
throw new Error(`No address found by string "${addressToSearch}"`)
}
} else {
// NOTE(pahaz): if you don't need to change the address you want to prevent any changes
Expand Down

0 comments on commit 14233ae

Please sign in to comment.