diff --git a/resources/service.go b/resources/service.go index 4b3f8cc..4896af9 100644 --- a/resources/service.go +++ b/resources/service.go @@ -48,13 +48,13 @@ func (s *Service) Update(ctx context.Context, id int64, req *UpdateRequest) (*Re func (s *Service) Delete(ctx context.Context, resourceID int64) error { path := fmt.Sprintf("/cdn/resources/%d", resourceID) - var deactivateRequestBody ActivateRequest = ActivateRequest{ + var body ActivateRequest = ActivateRequest{ Active: false, } var resource Resource // deactivate the resource instance before deletion - if err := s.r.Request(ctx, http.MethodPatch, path, &deactivateRequestBody, &resource); err != nil { + if err := s.r.Request(ctx, http.MethodPatch, path, &body, &resource); err != nil { return fmt.Errorf("request: %w", err) } diff --git a/rules/service.go b/rules/service.go index 7f422ad..5496984 100644 --- a/rules/service.go +++ b/rules/service.go @@ -54,13 +54,13 @@ func (s *Service) Update(ctx context.Context, resourceID, ruleID int64, req *Upd func (s *Service) Delete(ctx context.Context, resourceID, ruleID int64) error { path := fmt.Sprintf("/cdn/resources/%d/rules/%d", resourceID, ruleID) - var deactivateRequestBody ActivateRequest = ActivateRequest{ + var body ActivateRequest = ActivateRequest{ Active: false, } var rule Rule // deactivate the rule instance before deletion - if err := s.r.Request(ctx, http.MethodPatch, path, &deactivateRequestBody, &rule); err != nil { + if err := s.r.Request(ctx, http.MethodPatch, path, &body, &rule); err != nil { return fmt.Errorf("request: %w", err) }