Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

Commit

Permalink
remove unnecessary conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
Luiggi33 committed Jul 31, 2024
1 parent 438d555 commit 0a64434
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions internal/provider/node_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (r *nodeResource) Create(ctx context.Context, req resource.CreateRequest, r
plan.CreatedAt = types.StringValue(node.CreatedAt.Format(time.RFC3339))

if !plan.Description.IsNull() {
updatedNode, err := r.client.UpdateNode(int32(plan.ID.ValueInt32()), partialNode)
updatedNode, err := r.client.UpdateNode(plan.ID.ValueInt32(), partialNode)
if err != nil {
resp.Diagnostics.AddError(
"Error Updating Pterodactyl Node",
Expand Down Expand Up @@ -228,7 +228,7 @@ func (r *nodeResource) Read(ctx context.Context, req resource.ReadRequest, resp
}

// Get refreshed node value from Pterodactyl
node, err := r.client.GetNode(int32(state.ID.ValueInt32()))
node, err := r.client.GetNode(state.ID.ValueInt32())
if err != nil {
resp.Diagnostics.AddError(
"Error Reading Pterodactyl Node",
Expand Down Expand Up @@ -293,7 +293,7 @@ func (r *nodeResource) Update(ctx context.Context, req resource.UpdateRequest, r
}

// Update existing node
node, err := r.client.UpdateNode(int32(plan.ID.ValueInt32()), partialNode)
node, err := r.client.UpdateNode(plan.ID.ValueInt32(), partialNode)
if err != nil {
resp.Diagnostics.AddError(
"Error Updating Pterodactyl Node",
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/user_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (r *userResource) Read(ctx context.Context, req resource.ReadRequest, resp
}

// Get refreshed user value from Pterodactyl
user, err := r.client.GetUser(int32(state.ID.ValueInt32()))
user, err := r.client.GetUser(state.ID.ValueInt32())
if err != nil {
resp.Diagnostics.AddError(
"Error Reading Pterodactyl User",
Expand Down Expand Up @@ -185,7 +185,7 @@ func (r *userResource) Update(ctx context.Context, req resource.UpdateRequest, r
}

// Update existing user
user, err := r.client.UpdateUser(int32(plan.ID.ValueInt32()), partialUser)
user, err := r.client.UpdateUser(plan.ID.ValueInt32(), partialUser)
if err != nil {
resp.Diagnostics.AddError(
"Error Updating Pterodactyl User",
Expand Down

0 comments on commit 0a64434

Please sign in to comment.