chore(tools): centralize pagination cap helper
This commit is contained in:
@@ -48,10 +48,8 @@ func (t *RepoList) Call(ctx context.Context, raw json.RawMessage) (json.RawMessa
|
||||
if err := t.a.Check(args.Owner); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if args.Limit == 0 || args.Limit > 50 {
|
||||
args.Limit = 30
|
||||
}
|
||||
if args.Page == 0 {
|
||||
args.Limit = capLimit(args.Limit, 30)
|
||||
if args.Page < 1 {
|
||||
args.Page = 1
|
||||
}
|
||||
repos, err := t.c.ListRepos(ctx, args.Owner, args.Page, args.Limit)
|
||||
|
||||
Reference in New Issue
Block a user