mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-20 14:54:15 +01:00
(quality) simplified regex
This commit is contained in:
parent
7798df1f87
commit
31044a56ac
@ -77,7 +77,8 @@ export const ManageProductCategory: React.FC<ManageProductCategoryProps> = ({ pr
|
||||
<ProductCategoryForm action={action}
|
||||
productCategories={productCategories}
|
||||
productCategory={productCategory}
|
||||
onSuccess={handleSuccess} onError={onError} />
|
||||
onSuccess={handleSuccess}
|
||||
onError={onError} />
|
||||
</FabModal>
|
||||
</div>
|
||||
);
|
||||
|
@ -62,7 +62,7 @@ export const ProductCategoryForm: React.FC<ProductCategoryFormProps> = ({ action
|
||||
}, [watch]);
|
||||
// Check slug pattern
|
||||
// Only lowercase alphanumeric groups of characters separated by an hyphen
|
||||
const slugPattern = /^[a-z0-9]+(?:-[a-z0-9]+)*$/g;
|
||||
const slugPattern = /^[a-z\d]+(?:-[a-z\d]+)*$/g;
|
||||
|
||||
// Form submit
|
||||
const onSubmit: SubmitHandler<ProductCategory> = (category: ProductCategory) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user