Skip to content

fix(place): update PhoneInput onInput handler to mutate place phone#278

Open
spanchenko wants to merge 1 commit into
fleetbase:mainfrom
spanchenko:fix/place-phone-country-code
Open

fix(place): update PhoneInput onInput handler to mutate place phone#278
spanchenko wants to merge 1 commit into
fleetbase:mainfrom
spanchenko:fix/place-phone-country-code

Conversation

@spanchenko

Copy link
Copy Markdown

PR Description:

Summary

Fixes an issue where saving or updating a Place entity stored phone numbers without the international country dial code (E.164 format).

Cause of the Issue

In `addon/components/place/form.hbs`, the `<PhoneInput />` component was configured with `@onInput={{this.phone}}`. However,

this.phone is not defined in PlaceFormComponent, resolving @onInput to undefined.

Because `@onInput` was `undefined`, `PhoneInput`'s `intl-tel-input` event handler was never triggered to format the number with

the country dial code prefix, causing only raw input text to be saved instead of the formatted E.164 phone string.

Solution

Replaced `@onInput={{this.phone}}` with `@onInput={{fn (mut @resource.phone)}}`. This aligns `Place` form behavior with all other

forms across the codebase (such as contact/form.hbs, driver/form.hbs, customer/form.hbs, and vendor/form.hbs), ensuring
phone numbers are correctly mutated and stored in standard E.164 format (e.g. +1..., +7...).

Changes

- **`addon/components/place/form.hbs`**: Updated `<PhoneInput />` `@onInput` action to `{{fn (mut @resource.phone)}}`.

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