fix(portal): persist the region a manual-registration company picks

The Region select called setValue without shouldDirty. `region` is an
eTrade-bundle key, and stepPayload sends those only when the customer changed
them this session — so for the two routes that type their address by hand (a
co-operative, a foreign investor) the region was dropped on every save while
zone, woreda and kebele went through, because those are registered inputs and
are dirty by construction.

Found by the new onboarding e2e suite: both manual-route companies finished
onboarding with zone/woreda/kebele on file and region empty.
This commit is contained in:
Nathnael
2026-08-18 11:37:43 +00:00
parent 0b8b9c39ab
commit 333232c4d9
2 changed files with 9 additions and 277 deletions

View File

@@ -159,7 +159,15 @@ export default function CompanyInfoStep({
searchable
value={region || null}
onChange={(v) =>
setValue("region", v ?? "", { shouldValidate: true })
// shouldDirty, or the pick never reaches the API: `region` is
// an eTrade-bundle key, and `stepPayload` sends those only
// when the customer changed them this session. Without it a
// co-operative or foreign investor typed its address and the
// region alone silently vanished on save.
setValue("region", v ?? "", {
shouldValidate: true,
shouldDirty: true,
})
}
error={errors.region?.message}
/>