Commit b1b4fb4
fix(core): apply localeCode validation to taxonomy/menu locale filter (emdash-cms#1551)
The shared `localeFilterQuery` (used by taxonomy and menu endpoints) still
used a plain `z.string()` while `contentListQuery` and the search schemas
adopted the stricter, casing-preserving `localeCode`. Reusing `localeCode`
here tightens BCP-47 validation and keeps locale handling consistent across
the API: a malformed `?locale=` value is now rejected instead of silently
matching zero rows. Addresses non-blocking review feedback on emdash-cms#1572.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 960d5ba commit b1b4fb4
3 files changed
Lines changed: 9 additions & 2 deletions
File tree
- .changeset
- packages/core
- src/api/schemas
- tests/unit/api
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
160 | 167 | | |
161 | 168 | | |
162 | 169 | | |
| |||
0 commit comments