fix: hide slug field in product type form, auto-generate from name
Lo slug viene calcolato automaticamente dal nome senza che l'utente debba compilarlo — il campo è rimosso dal form ma continua ad essere inviato nel payload e visibile nella tabella.
This commit is contained in:
@@ -112,7 +112,6 @@ export default function AdminProductTypesPage() {
|
|||||||
<div className="bg-white rounded-lg border border-gray-200 p-6 mb-6">
|
<div className="bg-white rounded-lg border border-gray-200 p-6 mb-6">
|
||||||
<h2 className="font-semibold mb-4">{editId ? 'Edit Type' : 'New Product Type'}</h2>
|
<h2 className="font-semibold mb-4">{editId ? 'Edit Type' : 'New Product Type'}</h2>
|
||||||
<form onSubmit={handleSubmit} className="space-y-4">
|
<form onSubmit={handleSubmit} className="space-y-4">
|
||||||
<div className="grid grid-cols-2 gap-4">
|
|
||||||
<Input
|
<Input
|
||||||
label="Name"
|
label="Name"
|
||||||
value={name}
|
value={name}
|
||||||
@@ -122,13 +121,6 @@ export default function AdminProductTypesPage() {
|
|||||||
}}
|
}}
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
<Input
|
|
||||||
label="Slug"
|
|
||||||
value={slug}
|
|
||||||
onChange={(e) => setSlug(e.target.value)}
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium text-gray-700 mb-1">
|
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||||
Schema (JSON — define attribute fields)
|
Schema (JSON — define attribute fields)
|
||||||
|
|||||||
Reference in New Issue
Block a user