FIx: delete champs par default
This commit is contained in:
@@ -37,17 +37,9 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-2">
|
||||
<label class="flex items-center gap-2 text-xs">
|
||||
<input v-model="field.required" type="checkbox" class="checkbox checkbox-xs" />
|
||||
Obligatoire
|
||||
</label>
|
||||
<input
|
||||
v-model="field.defaultValue"
|
||||
type="text"
|
||||
class="input input-bordered input-xs"
|
||||
placeholder="Valeur par défaut"
|
||||
/>
|
||||
<div class="flex items-center gap-2 text-xs">
|
||||
<input v-model="field.required" type="checkbox" class="checkbox checkbox-xs" />
|
||||
Obligatoire
|
||||
</div>
|
||||
|
||||
<textarea
|
||||
@@ -108,7 +100,6 @@ const toEditorField = (input = {}) => ({
|
||||
name: typeof input.name === 'string' ? input.name : '',
|
||||
type: typeof input.type === 'string' && input.type ? input.type : 'text',
|
||||
required: Boolean(input.required),
|
||||
defaultValue: typeof input.defaultValue === 'string' ? input.defaultValue : '',
|
||||
optionsText: Array.isArray(input.options)
|
||||
? input.options.join('\n')
|
||||
: typeof input.optionsText === 'string'
|
||||
@@ -143,10 +134,6 @@ const normalizeFields = (fields) => {
|
||||
|
||||
const type = field.type || 'text'
|
||||
const required = Boolean(field.required)
|
||||
const defaultValue = typeof field.defaultValue === 'string'
|
||||
? field.defaultValue.trim() || undefined
|
||||
: undefined
|
||||
|
||||
let options
|
||||
if (type === 'select') {
|
||||
const raw = typeof field.optionsText === 'string' ? field.optionsText : ''
|
||||
@@ -158,9 +145,6 @@ const normalizeFields = (fields) => {
|
||||
}
|
||||
|
||||
const normalized = { name, type, required }
|
||||
if (defaultValue !== undefined) {
|
||||
normalized.defaultValue = defaultValue
|
||||
}
|
||||
if (options) {
|
||||
normalized.options = options
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user