Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix setting last modified by issue in url filtering rule resource #19

Merged
merged 1 commit into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix setting last modified by issue in url filtering rule resource
  • Loading branch information
amazzalel-habib committed Oct 21, 2021
commit 6f46cc626ca89ea2f10575d006b86b266840ecb7
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