Skip to content

Commit

Permalink
adjust count api
Browse files Browse the repository at this point in the history
  • Loading branch information
StardustDL committed Jul 22, 2020
1 parent b08489e commit 8bb074d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defaults:
env:
go-version: "1.14"
dotnet-version: "3.1.x"
build_version: "0.0.3.${{ github.run_number }}-preview"
build_version: "0.0.4.${{ github.run_number }}-preview"

jobs:
pub-images:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defaults:
env:
go-version: "1.14"
dotnet-version: "3.1.x"
build_version: "0.0.3.${{ github.run_number }}-preview"
build_version: "0.0.4.${{ github.run_number }}-preview"

jobs:
ci:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defaults:

env:
dotnet-version: "3.1.x"
build_version: "0.0.3"
build_version: "0.0.4"
go-version: "1.14"

jobs:
Expand Down
5 changes: 4 additions & 1 deletion src/repositories/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ func (repo *CommentRepository) Count(query *models.CommentQuery) (int64, error)
if query.Email != "" {
session = session.Where("Email = ?", query.Email)
}
if query.Limit == 0 {
query.Limit = 10
}
cmt := new(models.Comment)
total, err := session.Count(cmt)
total, err := session.Limit(query.Limit, query.Offset).Count(cmt)
return total, err
}

0 comments on commit 8bb074d

Please sign in to comment.