Skip to content

fix: contact phone and fax import when values are empty#326

Open
alexhuk3 wants to merge 1 commit into
dnsimple:mainfrom
alexhuk3:fix/contact-phone-fax-import
Open

fix: contact phone and fax import when values are empty#326
alexhuk3 wants to merge 1 commit into
dnsimple:mainfrom
alexhuk3:fix/contact-phone-fax-import

Conversation

@alexhuk3
Copy link
Copy Markdown

What
Fixes contact phone and fax fields not being populated during import or refresh when the current state value is empty or unknown.

Why
When importing contacts, the API returns values for phone and fax, and also provides phone_normalized and fax_normalized.
However, the provider only populated the normalized fields, while phone and fax could remain empty in state.
This caused an extra update right after import.

How
During contact read:
always set phone_normalized and fax_normalized from the API response (contact.Phone / contact.Fax).
if phone and/or fax is empty, backfill it from the same API value (contact.Phone / contact.Fax) to avoid a post-import update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant