diff --git a/client/products/products.go b/client/products/products.go index 88615792..2e68036c 100644 --- a/client/products/products.go +++ b/client/products/products.go @@ -372,11 +372,16 @@ func updateProduct(productSettings ProductSettings) (respBody []byte, err error) if reflect.DeepEqual(*OperationGroup, operationGroup{}) { return nil, fmt.Errorf("can't unmarshal json to OperationGroup") } - //check to see the operation config type is the same - if OperationGroup.OperationConfigType != p.OperationGroup.OperationConfigType { - return nil, fmt.Errorf("updated operationConfigType must match the existing operationConfigType - ", OperationGroup.OperationConfigType) + + if p.OperationGroup != nil { + //check to see the operation config type is the same + if OperationGroup.OperationConfigType != p.OperationGroup.OperationConfigType { + return nil, fmt.Errorf("updated operationConfigType must match the existing operationConfigType - ", OperationGroup.OperationConfigType) + } + p.OperationGroup.OperationConfigs = append(p.OperationGroup.OperationConfigs, OperationGroup.OperationConfigs...) + } else { + p.OperationGroup = OperationGroup } - p.OperationGroup.OperationConfigs = append(p.OperationGroup.OperationConfigs, OperationGroup.OperationConfigs...) } if len(productSettings.GqlOperationGrp) > 0 {