Skip to content

Commit

Permalink
Merge pull request #19 from willguibr/fix-setting-lastmodifiedby-issue
Browse files Browse the repository at this point in the history
fix setting last modified by issue in url filtering rule resource
  • Loading branch information
willguibr authored Oct 21, 2021
2 parents 31c93ad + 6f46cc6 commit b0aa00f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions zia/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,13 @@ func flattenIDNameExtensions(list []common.IDNameExtensions) []interface{} {
}

func flattenLastModifiedBy(lastModifiedBy *common.IDNameExtensions) []interface{} {
lastModified := make([]interface{}, 1)
for lastModifiedBy != nil {
lastModified[0] = map[string]interface{}{
lastModified := make([]interface{}, 0)
if lastModifiedBy != nil {
lastModified = append(lastModified, map[string]interface{}{
"id": lastModifiedBy.ID,
"name": lastModifiedBy.Name,
"extensions": lastModifiedBy.Extensions,
}
})
}

return lastModified
}
2 changes: 1 addition & 1 deletion zia/data_source_zia_url_filtering_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func dataSourceURLFilteringRules() *schema.Resource {
Computed: true,
},
"last_modified_by": {
Type: schema.TypeList,
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand Down

0 comments on commit b0aa00f

Please sign in to comment.