Allow duplicate category feedback via submission

This commit is contained in:
beatz174-bit
2025-12-01 15:28:52 +10:00
parent 115c520b22
commit 166b486ad7
+2 -6
View File
@@ -20,12 +20,8 @@ const ManageCategoriesScreen = () => {
}, {});
}, [categories, products]);
const validateCategoryName = (value: string, editingId?: string | null) => {
const trimmed = value.trim();
if (!trimmed) return false;
return !categories.some(
(category) => category.id !== editingId && category.name.toLowerCase() === trimmed.toLowerCase(),
);
const validateCategoryName = (value: string) => {
return Boolean(value.trim());
};
const addCategory = async (name: string): Promise<ActionOutcome> => {