fix(custom-fields) : preserve machineContextOnly through sanitizeCustomFields
The sanitize layer was reconstructing the field object without machineContextOnly, causing it to always be false in the save payload regardless of checkbox state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -85,7 +85,10 @@ export const sanitizeCustomFields = (fields: any[]): ComponentModelCustomField[]
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const result: ComponentModelCustomField = { name, type, required }
|
const machineContextOnly =
|
||||||
|
typeof valueObject?.machineContextOnly === 'boolean' ? valueObject.machineContextOnly : !!field?.machineContextOnly
|
||||||
|
|
||||||
|
const result: ComponentModelCustomField = { name, type, required, machineContextOnly }
|
||||||
if (options) {
|
if (options) {
|
||||||
result.options = options
|
result.options = options
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user