fix: category slug-uniqueness check fails closed on API error
isSlugTaken previously caught network/API errors and returned false, letting the save proceed as if the slug were free. Now the error propagates and blocks save via a distinct slugCheckError state, surfaced in the category form with its own hint. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1533,6 +1533,7 @@ export const en: Translations = {
|
||||
title: 'Title',
|
||||
slug: 'URL slug',
|
||||
slugTaken: 'This slug is already used by another category.',
|
||||
slugCheckError: 'Could not verify this slug is unique. Try again before saving.',
|
||||
parent: 'Parent category',
|
||||
noParent: 'No parent (top level)',
|
||||
icon: 'Icon',
|
||||
|
||||
@@ -1528,6 +1528,7 @@ export const hy: Translations = {
|
||||
title: 'Անուն',
|
||||
slug: 'URL հասցե',
|
||||
slugTaken: 'Այս հասցեն արդեն օգտագործվում է այլ կատեգորիայի կողմից։',
|
||||
slugCheckError: 'Չհաջողվեց ստուգել հասցեի եզակիությունը։ Փորձեք կրկին՝ նախքան պահպանելը։',
|
||||
parent: 'Ծնող կատեգորիա',
|
||||
noParent: 'Առանց ծնողի (վերին մակարդակ)',
|
||||
icon: 'Պատկերակ',
|
||||
|
||||
@@ -1528,6 +1528,7 @@ export const ru: Translations = {
|
||||
title: 'Название',
|
||||
slug: 'URL-адрес',
|
||||
slugTaken: 'Этот адрес уже используется другой категорией.',
|
||||
slugCheckError: 'Не удалось проверить уникальность адреса. Повторите попытку перед сохранением.',
|
||||
parent: 'Родительская категория',
|
||||
noParent: 'Без родителя (верхний уровень)',
|
||||
icon: 'Иконка',
|
||||
|
||||
@@ -1541,6 +1541,7 @@ export interface Translations {
|
||||
title: string;
|
||||
slug: string;
|
||||
slugTaken: string;
|
||||
slugCheckError: string;
|
||||
parent: string;
|
||||
noParent: string;
|
||||
icon: string;
|
||||
|
||||
Reference in New Issue
Block a user