Skip to content

Commit

Permalink
fix: pagination not working correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
imranismail committed Jun 11, 2024
1 parent ea0b004 commit 5393410
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func resourceSumologicS3DataForwardingDestinationCreate(d *schema.ResourceData,
d.SetId(createdDfd.ID)
}

return resourceSumologicS3DataForwardingDestinationUpdate(d, meta)
return resourceSumologicS3DataForwardingDestinationRead(d, meta)
}

func resourceSumologicS3DataForwardingDestinationRead(d *schema.ResourceData, meta interface{}) error {
Expand Down
2 changes: 1 addition & 1 deletion sumologic/resource_sumologic_s3_data_forwarding_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func resourceSumologicS3DataForwardingRuleCreate(d *schema.ResourceData, meta in
d.SetId(createdDfd.IndexID)
}

return resourceSumologicS3DataForwardingRuleUpdate(d, meta)
return resourceSumologicS3DataForwardingRuleRead(d, meta)
}

func resourceSumologicS3DataForwardingRuleRead(d *schema.ResourceData, meta interface{}) error {
Expand Down
9 changes: 8 additions & 1 deletion sumologic/sumologic_partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ type ListPartitionResp struct {
Next string `json:"next"`
}

func (s *ListPartitionResp) Reset() {
s.Data = nil
s.Next = ""
}

func (s *Client) ListPartitions() ([]Partition, error) {
var listPartitionResp ListPartitionResp

data, _, err := s.Get("v1/partitions")
data, _, err := s.Get("v1/partitions?limit=1000")
if err != nil {
return nil, err
}
Expand All @@ -32,6 +37,8 @@ func (s *Client) ListPartitions() ([]Partition, error) {
return nil, err
}

listPartitionResp.Reset()

err = json.Unmarshal(data, &listPartitionResp)
if err != nil {
return nil, err
Expand Down

0 comments on commit 5393410

Please sign in to comment.