Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
fix support for operation groups
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Jun 14, 2021
1 parent c40d475 commit 02079f1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions client/products/products.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 02079f1

Please sign in to comment.