fix(custom-fields) : preserve CustomField ID in piece structure payload

Prevents data loss when saving ModelType: the frontend now sends existing
CustomField IDs so the backend can match them instead of deleting and recreating.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-03-17 19:07:37 +01:00
parent 53530dc16d
commit db630e315b
3 changed files with 11 additions and 0 deletions

View File

@@ -158,6 +158,13 @@ const buildPayload = (
orderIndex: index,
}
if (field.id) {
payload.id = field.id
}
if (field.customFieldId) {
payload.customFieldId = field.customFieldId
}
if (type === 'select') {
const options = normalizeLineEndings(field.optionsText)
.split('\n')