diff --git a/app/composables/usePieceStructureEditorLogic.ts b/app/composables/usePieceStructureEditorLogic.ts index 3bb7a3f..4d610fe 100644 --- a/app/composables/usePieceStructureEditorLogic.ts +++ b/app/composables/usePieceStructureEditorLogic.ts @@ -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') diff --git a/app/shared/model/pieceProductStructure.ts b/app/shared/model/pieceProductStructure.ts index a7dff65..8e2368e 100644 --- a/app/shared/model/pieceProductStructure.ts +++ b/app/shared/model/pieceProductStructure.ts @@ -125,6 +125,8 @@ const hydratePieceCustomFields = (fields: any[]): PieceModelStructureEditorField ? field.options.join('\n') : '', orderIndex: typeof field?.orderIndex === 'number' ? field.orderIndex : index, + ...(field?.id ? { id: field.id } : {}), + ...(field?.customFieldId ? { customFieldId: field.customFieldId } : {}), })) } diff --git a/app/shared/types/inventory.ts b/app/shared/types/inventory.ts index e12549a..1a531d6 100644 --- a/app/shared/types/inventory.ts +++ b/app/shared/types/inventory.ts @@ -61,6 +61,8 @@ export interface PieceModelCustomField { key?: string value?: unknown defaultValue?: string | null + id?: string + customFieldId?: string } export interface PieceModelProduct {