Skip to content

fix(apm): rename phone "value" to "number" to conform with the BE API contracts - #225

Merged
tomasz-pazdziurek-cko merged 3 commits into
masterfrom
fix/apm-phone-number-field-name
Dec 2, 2025
Merged

tomasz-pazdziurek-cko merged 3 commits into
masterfrom
fix/apm-phone-number-field-name

Conversation

@tomasz-pazdziurek-cko

@tomasz-pazdziurek-cko tomasz-pazdziurek-cko commented Nov 28, 2025 •

Copy link
Copy Markdown
Contributor

Description

We're sending phone number as "value" field instead of "number" and BE ignores it. As a result, we end up sending empty phone number to the PSP.

Solution

Rename "value" field to "number" to conform with the BE API contracts.

Demo

Screen.Recording.2025-11-28.at.13.03.50.mov

Checklist

  • I bumped the version of the project using yarn bump-version
  • I have checked the code for any potential issues
  • I tested my changes in the browser

Notes

Jira Issue

@tomasz-pazdziurek-cko
tomasz-pazdziurek-cko marked this pull request as ready for review November 28, 2025 14:47
@tomasz-pazdziurek-cko
tomasz-pazdziurek-cko marked this pull request as draft November 28, 2025 14:48
@tomasz-pazdziurek-cko
tomasz-pazdziurek-cko marked this pull request as ready for review December 2, 2025 09:45
@tomasz-pazdziurek-cko
tomasz-pazdziurek-cko merged commit da68676 into master Dec 2, 2025
@tomasz-pazdziurek-cko
tomasz-pazdziurek-cko deleted the fix/apm-phone-number-field-name branch December 2, 2025 09:46
roshan-gorasia-cko added a commit that referenced this pull request Sep 8, 2026
The prefill computed in NextSteps never reached the phone field. The field
reads a `value` prop; the form's only call site passed it as `number`, and
`Props<T>`'s `[key: string]: any` index signature let the misnamed prop
typecheck and vanish into the input's attributes. A prefilled phone rendered
as an empty box on the locale default country.

`normalizePhoneValue` also returned the pre-#225 `value` key, so a prefilled
phone submitted without the user touching the field posted `value` where the
API expects `number`. It now emits `number`, matching the declared
`PhoneState` and the field's own `oninput`; both keys are still accepted as
input, so the documented `initialData` object form keeps working.

`validateField` read `value` too, which made `required` pass vacuously for
any phone once the field had emitted its own shape. It now reads the national
number under either key, so an empty phone is caught.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants