mirror of
https://github.com/usememos/memos.git
synced 2026-03-16 12:55:13 +08:00
fix: add MaxPageSize cap and remove extra blank lines in imports
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b962f0c159
commit
10adb5fd5e
4 changed files with 3 additions and 3 deletions
|
|
@ -29,6 +29,9 @@ func (s *APIV1Service) ListActivities(ctx context.Context, request *v1pb.ListAct
|
|||
if limit <= 0 {
|
||||
limit = DefaultPageSize
|
||||
}
|
||||
if limit > MaxPageSize {
|
||||
limit = MaxPageSize
|
||||
}
|
||||
limitPlusOne := limit + 1
|
||||
activities, err := s.Store.ListActivities(ctx, &store.FindActivity{
|
||||
Limit: &limitPlusOne,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue