Skip to content

fix: normalize phone number and ensure label selection#2451

Open
bhavesh-018 wants to merge 5 commits intokrayin:2.1from
bhavesh-018:fix/lead-contact-phone-validation
Open

fix: normalize phone number and ensure label selection#2451
bhavesh-018 wants to merge 5 commits intokrayin:2.1from
bhavesh-018:fix/lead-contact-phone-validation

Conversation

@bhavesh-018
Copy link

@bhavesh-018 bhavesh-018 commented Feb 12, 2026

Issue Reference

fix #2447

Description

Fixes phone number validation issue during manual lead creation when selecting a contact created via MagicAI or file upload.
Phone numbers stored with country code and formatting (e.g. +91-7120966590) were triggering validation errors and causing dropdown label mismatch.

Changes:

  • Normalized phone numbers using libphonenumber-js to extract national number.
  • Ensured label values are lowercase (work, home) for proper dropdown selection.
  • Added default fallback to work when label is missing.

How To Test This?

  1. Create a Contact Person via MagicAI or import with a formatted number (e.g. +91-7120966590).
  2. Create a Lead manually.
  3. Select the same contact.
  4. Verify:
    • Phone number auto-fills correctly.
    • Dropdown selects correct label.
    • No validation error appears.

Documentation

  • My pull request requires an update on the documentation repository.

Branch Selection

  • Target Branch: master

Tailwind Reordering

  • Tailwind classes reordered where applicable.

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.

Phone number validation fails when selecting a Contact Person created via MagicAI during manual lead creation

1 participant