fix: admin/options: empty mime column for 'auto'
Massimo Melina committed
May 14, 2024 at 21:59 UTC
ee4a8b3535810420461a709261730f7976b4a2aa
1 file changed
+2
-4
admin/src/OptionsPage.ts
+2
-4
@@ -167,12 +167,10 @@ export default function OptionsPage() {
167
color: 'warning.main', ml: 1
168
}))
169
} },
170
- { k: 'v', label: "Mime type", placeholder: "auto", $width: 2,
171
- toField: (x: any) => x === 'auto' ? '' : x, fromField: (x: string) => !x ? 'auto' : x.toLowerCase(),
172
- helperText: "Leave empty to get automatic value", },
170
+ { k: 'v', label: "Mime type", placeholder: "auto", $width: 2, helperText: "Leave empty to get automatic value" },
171
],
172
toField: x => Object.entries(x || {}).map(([k,v]) => ({ k, v })),
175
- fromField: x => Object.fromEntries(x.map((row: any) => [row.k, row.v])),
173
+ fromField: x => Object.fromEntries(x.map((row: any) => [row.k, row.v || 'auto'])),
174
},
175
{ k: 'block', label: false, comp: ArrayField, prepend: true, sm: 12,
176
fields: [