Skip to content

Commit

Permalink
Fix array refresh funciton sync (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvirsegev authored Jul 27, 2023
1 parent d3149d7 commit 3e4cd26
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions port/action/array.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func addArrayPropertiesToResource(v *cli.ActionProperty) (*ArrayPropModel, error
switch v.Items["type"] {
case "string":
arrayProp.StringItems = &StringItems{}
if v.Default != nil {
if v.Default != nil && arrayProp.DefaultJqQuery.IsNull() {
stringArray := make([]string, len(v.Default.([]interface{})))
for i, v := range v.Default.([]interface{}) {
stringArray[i] = v.(string)
Expand All @@ -193,7 +193,7 @@ func addArrayPropertiesToResource(v *cli.ActionProperty) (*ArrayPropModel, error
}
case "number":
arrayProp.NumberItems = &NumberItems{}
if v.Default != nil {
if v.Default != nil && arrayProp.DefaultJqQuery.IsNull() {
numberArray := make([]float64, len(v.Default.([]interface{})))
attrs := make([]attr.Value, 0, len(numberArray))
for _, value := range v.Default.([]interface{}) {
Expand All @@ -204,7 +204,7 @@ func addArrayPropertiesToResource(v *cli.ActionProperty) (*ArrayPropModel, error

case "boolean":
arrayProp.BooleanItems = &BooleanItems{}
if v.Default != nil {
if v.Default != nil && arrayProp.DefaultJqQuery.IsNull() {
booleanArray := make([]bool, len(v.Default.([]interface{})))
attrs := make([]attr.Value, 0, len(booleanArray))
for _, value := range v.Default.([]interface{}) {
Expand All @@ -215,7 +215,7 @@ func addArrayPropertiesToResource(v *cli.ActionProperty) (*ArrayPropModel, error

case "object":
arrayProp.ObjectItems = &ObjectItems{}
if v.Default != nil {
if v.Default != nil && arrayProp.DefaultJqQuery.IsNull() {
objectArray := make([]map[string]interface{}, len(v.Default.([]interface{})))
attrs := make([]attr.Value, 0, len(objectArray))
for _, value := range v.Default.([]interface{}) {
Expand Down

0 comments on commit 3e4cd26

Please sign in to comment.