Skip to content

Commit

Permalink
Fix multiple emails in notification policy
Browse files Browse the repository at this point in the history
Setting data["id"] only saves the last value as it keeps writing to the same map.
Instead a new map should be created for each value.

Fixes: cloudflare#1917
  • Loading branch information
Qantas94Heavy committed Mar 1, 2023
1 parent 17ecc7c commit 6d45e91
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ func getNotificationMechanisms(s *schema.Set) []cloudflare.NotificationMechanism

func setNotificationMechanisms(md []cloudflare.NotificationMechanismData) *schema.Set {
mechanisms := make([]interface{}, 0)
data := make(map[string]interface{})

for _, m := range md {
data := make(map[string]interface{})
data["name"] = m.Name
data["id"] = m.ID
mechanisms = append(mechanisms, data)
Expand Down

0 comments on commit 6d45e91

Please sign in to comment.