Skip to content

Commit

Permalink
Merge pull request cheelim1#13 from cheelim1/fix/jc-update-user2
Browse files Browse the repository at this point in the history
Fix Update JC User display name
  • Loading branch information
cheelim1 authored Apr 17, 2024
2 parents 460b91d + 2abb9b2 commit fdb78af
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions jumpcloud/resource_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,13 @@ func resourceUserUpdate(d *schema.ResourceData, m interface{}) error {

// Dynamically set the display name if there's a change
if d.HasChange("display_name") {
if displayName, ok := d.GetOk("display_name"); ok {
payload.Displayname = displayName.(string)
_, ok := d.GetOk("display_name")
if !ok {
// The attribute was removed from the configuration, so we explicitly clear it.
payload.Displayname = ""
} else {
payload.Displayname = "" // Clear display name if not provided in the config
// The attribute has a new value.
payload.Displayname = d.Get("display_name").(string)
}
}

Expand Down

0 comments on commit fdb78af

Please sign in to comment.