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:
Stevche Radevski
2024-02-20 12:46:42 +01:00
committed by GitHub
parent c319edb8e0
commit cfefd59249
10 changed files with 436 additions and 132 deletions

View File

@@ -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),
}))
)
}