fix(core): дозаполнять ВСЕ незаданные params modify их live-значением (по коду), иначе модификатор сбрасывает create-поля в дефолт

This commit is contained in:
Repinoid
2026-09-22 18:54:51 +03:00
parent 4f7edc1200
commit c420ea0e70
+5 -6
View File
@@ -1599,9 +1599,11 @@ func (c *UniversalClient) RunInstanceOperationUniversalByCode(ctx context.Contex
if sent[param.SvcOperationCfsParamId] { if sent[param.SvcOperationCfsParamId] {
continue continue
} }
if !param.IsRequired { // Дозаполняем ВСЕ незаданные параметры их текущим live-значением
continue // (ParamValue из GET ?fields=cfsParams), а не только required.
} // Бэкенд для modify трактует пропущенный/null как reset-to-default,
// из-за чего частичный payload затирал create-поля (см. prompt_for_opus_modifier_null_bug.md).
// Поведение выровнено под RunInstanceOperationUniversalWithDefaults.
val := "" val := ""
if param.ParamValue != nil { if param.ParamValue != nil {
val = *param.ParamValue val = *param.ParamValue
@@ -1609,9 +1611,6 @@ func (c *UniversalClient) RunInstanceOperationUniversalByCode(ctx context.Contex
val = *param.DefaultValue val = *param.DefaultValue
} }
val = normalizeUniversalValueV6(val, param) val = normalizeUniversalValueV6(val, param)
if !param.IsRequired && strings.TrimSpace(val) == "" {
continue
}
pPayload := genericParamReq{ pPayload := genericParamReq{
InstanceOperationUid: opUid, InstanceOperationUid: opUid,