Skip to content

Commit

Permalink
Fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang committed Jun 19, 2024
1 parent 1ca51b7 commit 67bf026
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions services/registry/registry_svc.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,16 +393,20 @@ func (s *RegistryService) ListNodeVersions(ctx context.Context, client *ent.Clie
}
total, err := query.Count(ctx)
if err != nil {
return nil, fmt.Errorf("failed to count nodes: %w", err)
return nil, fmt.Errorf("failed to count node versions: %w", err)
}
versions, err := query.All(ctx)
if err != nil {
return nil, fmt.Errorf("failed to list node versions: %w", err)
}

totalPages := total / filter.PageSize
if total%filter.PageSize != 0 {
totalPages += 1
totalPages := 0
if total > 0 && filter.PageSize > 0 {
totalPages = total / filter.PageSize

if total%filter.PageSize != 0 {
totalPages += 1
}
}
return &ListNodeVersionsResult{
Total: total,
Expand Down

0 comments on commit 67bf026

Please sign in to comment.