Skip to content

Commit

Permalink
user field type can also not be changed
Browse files Browse the repository at this point in the history
  • Loading branch information
970uraj committed Aug 21, 2024
1 parent a7f8db7 commit 43577a4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions zendesk/resource_zendesk_user_field.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,13 @@ func readUserField(ctx context.Context, d identifiableGetterSetter, zd *client.C
}

func resourceZendeskUserFieldUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
if hasChange := d.HasChange("type"); hasChange {
if hasChange {
return diag.FromErr(
fmt.Errorf("field is write-once. The 'type' cannot be changed after resource creation"),
)
}
}
zd := meta.(*client.Client)
return updateUserField(ctx, d, zd)
}
Expand Down

0 comments on commit 43577a4

Please sign in to comment.