Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,5 @@ go fmt "./..."
echo "Adding changed files back to git"
git diff --cached --name-only --diff-filter=ACM | grep -E "\.(go)$" | xargs git add
```

Update Readme
4 changes: 2 additions & 2 deletions cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func NewCreateCommand(parentCmd *cobra.Command) func() {
return err
}

err = json.PrintJson(string(outputJson))
err = json.PrintJsonToStdout(string(outputJson))

if err != nil {
return err
Expand All @@ -141,7 +141,7 @@ func NewCreateCommand(parentCmd *cobra.Command) func() {
}
}

return json.PrintJson(body)
return json.PrintJsonToStdout(body)
}

}
Expand Down
16 changes: 14 additions & 2 deletions cmd/delete-all.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,27 @@ func deleteAllInternal(ctx context.Context, args []string) error {
}

params := url.Values{}
params.Add("page[limit]", "25")
params.Add("page[limit]", "100")

resp, err := httpclient.DoRequest(ctx, "GET", resourceURL, params.Encode(), nil)

if err != nil {
return err
}

ids, totalCount, err := apihelper.GetResourceIdsFromHttpResponse(resp)
if resp.StatusCode >= 400 {
log.Warnf("Could not retrieve page of data, aborting")
break
}

bodyTxt, err := io.ReadAll(resp.Body)

if err != nil {
return err
}

ids, totalCount, err := apihelper.GetResourceIdsFromHttpResponse(bodyTxt)

resp.Body.Close()

allIds := make([][]id.IdableAttributes, 0)
Expand Down
4 changes: 2 additions & 2 deletions cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func NewDeleteCommand(parentCmd *cobra.Command) func() {
if err != nil {
if body != "" {
if !noBodyPrint {
json.PrintJson(body)
json.PrintJsonToStdout(body)
}
}
return err
Expand All @@ -104,7 +104,7 @@ func NewDeleteCommand(parentCmd *cobra.Command) func() {
if noBodyPrint {
return nil
} else {
return json.PrintJson(body)
return json.PrintJsonToStdout(body)
}
}

Expand Down
Loading
Loading