Skip to content

Commit

Permalink
fix: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
SiasMey committed Dec 6, 2024
1 parent 48010c2 commit 94a3c31
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions internal/provider/resources/resource_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,6 @@ func (r *groupResource) Create(

plan.ID = types.StringValue(group.Id)
plan.Name = types.StringValue(group.Name)
// only update parent if not attached to root node (else leave it as null)
parentGroup, _ := r.getGroup(ctx, group.Parent.Id)
if parentGroup != nil && !util.IsRoot(*parentGroup) {
plan.ParentGroupID = types.StringValue(group.Parent.Id)
}

diags = resp.State.Set(ctx, plan)
resp.Diagnostics.Append(diags...)
Expand Down Expand Up @@ -201,11 +196,9 @@ func (r *groupResource) Update(
req resource.UpdateRequest,
resp *resource.UpdateResponse,
) {
var plan, state groupResourceModel
var plan groupResourceModel
diags := req.Plan.Get(ctx, &plan)
resp.Diagnostics.Append(diags...)
diags = req.State.Get(ctx, &state)
resp.Diagnostics.Append(diags...)
if resp.Diagnostics.HasError() {
return
}
Expand All @@ -227,11 +220,6 @@ func (r *groupResource) Update(

plan.ID = types.StringValue(group.Id)
plan.Name = types.StringValue(group.Name)
// only update parent if not attached to root node (else leave it as null)
parentGroup, _ := r.getGroup(ctx, group.Parent.Id)
if parentGroup != nil && !util.IsRoot(*parentGroup) {
state.ParentGroupID = types.StringValue(group.Parent.Id)
}

diags = resp.State.Set(ctx, plan)
resp.Diagnostics.Append(diags...)
Expand Down

0 comments on commit 94a3c31

Please sign in to comment.