fix(custom-metrics): say "name taken" only for a name clash

The form read every 409 as "a metric with this name already exists".
Now that it keeps one idempotency key across taps, a second tap while
the first create is still running also answers 409, and the form told
the person their name was taken. The create and rename routes send
`customMetric.name_taken` with the clash, and the form matches the code.
This commit is contained in:
Marc-André Bombeck committed 2026-11-12 12:52:39 +01:00
1 parent 671245c782
commit 706af61cdd
6 files changed
+14 -3

No files matched your search

+1
View File
@@ -140,6 +140,7 @@ export const ERROR_CODE_CATALOGUE: Readonly<Record<string, readonly string[]>> =
"coach-prefs.body.invalid_shape",
],
consent: ["consent.ai.confirmRequired", "consent.ai.required"],
customMetric: ["customMetric.name_taken"],
cycle: [
"cycle.bulk.invalid",
"cycle.bulk.too_large",