Skip to content

Commit

Permalink
prioritize email change, so it doesn't conflict with other api operat…
Browse files Browse the repository at this point in the history
…ions such as suspension or archival when done at the same time
  • Loading branch information
SamuZad committed Aug 24, 2023
1 parent 94f4740 commit 6f595e3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/provider/resource_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,16 @@ func resourceUserUpdate(ctx context.Context, d *schema.ResourceData, meta interf
// Strings

if d.HasChange("primary_email") {
if d.IsNewResource() == false {
emailupdate := directory.User{
PrimaryEmail: primaryEmail,
}
_, err := usersService.Update(d.Id(), &emailupdate).Do()
if err != nil {
return diag.FromErr(err)
}
}

userObj.PrimaryEmail = primaryEmail
}

Expand Down

0 comments on commit 6f595e3

Please sign in to comment.