mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 14:08:11 +00:00
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:
@@ -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}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user