Skip to content

Commit

Permalink
CDP-617 fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
freenoth committed Mar 14, 2024
1 parent e805918 commit f6812cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions resources/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
4 changes: 2 additions & 2 deletions rules/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit f6812cc

Please sign in to comment.