Skip to content

Commit

Permalink
Add change key action for channels
Browse files Browse the repository at this point in the history
  • Loading branch information
mvantellingen committed Dec 17, 2020
1 parent 4bdd912 commit 78220ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v0.25.2 (2020-12-17)
====================
- Implement changing key of an existing channel resource

v0.25.1 (2020-12-05)
====================
- Fix a bug in `resource_type` when the input_hint of a field was modified.
Expand Down
7 changes: 7 additions & 0 deletions commercetools/resource_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ func resourceChannelUpdate(d *schema.ResourceData, m interface{}) error {
Actions: []commercetools.ChannelUpdateAction{},
}

if d.HasChange("key") {
newKey := d.Get("key").(string)
input.Actions = append(
input.Actions,
&commercetools.ChannelChangeKeyAction{Key: newKey})
}

if d.HasChange("name") {
newName := commercetools.LocalizedString(
expandStringMap(d.Get("name").(map[string]interface{})))
Expand Down

0 comments on commit 78220ac

Please sign in to comment.