feat(regions): Add support for updating countries in a region (#6432)
**What** Add missing support for updating countries on the POST /admin/regions/:id route. Furthermore, the PR refactors how the normalization and validation was handled in both create and update scenarios. Finally, the PR adds a unique index on the country entity, which ensures at the DB level that we cannot have a duplicate country in the DB for a single region.
This commit is contained in:
@@ -48,6 +48,7 @@ export const updateRegionsStep = createStep(
|
||||
name: r.name,
|
||||
currency_code: r.currency_code,
|
||||
metadata: r.metadata,
|
||||
countries: r.countries.map((c) => c.iso_2),
|
||||
}))
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user