Fix backend_options cleanup to exclude empty arrays in InstanceDialog

This commit is contained in:
2025-10-09 18:38:33 +02:00
parent 56b95d1243
commit 5d958ed283

View File

@@ -106,7 +106,7 @@ const InstanceDialog: React.FC<InstanceDialogProps> = ({
// Clean up undefined values to avoid sending empty fields // Clean up undefined values to avoid sending empty fields
const cleanOptions: CreateInstanceOptions = {}; const cleanOptions: CreateInstanceOptions = {};
Object.entries(formData).forEach(([key, value]) => { Object.entries(formData).forEach(([key, value]) => {
if (key === 'backend_options' && value && typeof value === 'object') { if (key === 'backend_options' && value && typeof value === 'object' && !Array.isArray(value)) {
// Handle backend_options specially - clean nested object // Handle backend_options specially - clean nested object
const cleanBackendOptions: any = {}; const cleanBackendOptions: any = {};
Object.entries(value).forEach(([backendKey, backendValue]) => { Object.entries(value).forEach(([backendKey, backendValue]) => {