Skip to content

Commit

Permalink
Creates board.GetActionsWithoutLimits(args).
Browse files Browse the repository at this point in the history
  • Loading branch information
adlio committed Sep 19, 2018
1 parent 43d0dcd commit bc3ed9c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions action.go
Expand Up @@ -50,6 +50,28 @@ func (b *Board) GetActions(args Arguments) (actions ActionCollection, err error)
return
}

func (b *Board) GetActionsWithoutLimits(args Arguments) (actions ActionCollection, err error) {
path := fmt.Sprintf("boards/%s/actions", b.ID)
lastID := ""
if args["limit"] == "" {
args["limit"] = "1000"
}
for {
batchActions := make(ActionCollection, 0)
if lastID != "" {
args["before"] = lastID
}
err = b.client.Get(path, args, &batchActions)
if err != nil || len(batchActions) == 0 {
return
}
lastID = batchActions[len(batchActions)-1].ID
for i, _ := range batchActions {
actions = append(actions, batchActions[i])
}
}
}

func (l *List) GetActions(args Arguments) (actions ActionCollection, err error) {
path := fmt.Sprintf("lists/%s/actions", l.ID)
err = l.client.Get(path, args, &actions)
Expand Down

0 comments on commit bc3ed9c

Please sign in to comment.