We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82ec230 commit 16103bbCopy full SHA for 16103bb
models/issue.go
@@ -1510,14 +1510,10 @@ func Issues(opts *IssuesOptions) ([]*Issue, error) {
1510
func CountIssues(opts *IssuesOptions) (int64, error) {
1511
e := db.GetEngine(db.DefaultContext)
1512
1513
- var cnt int64
1514
sess := e.Select("COUNT(issue.id) AS count").Table("issue")
1515
sess.Join("INNER", "repository", "`issue`.repo_id = `repository`.id")
1516
opts.setupSessionNoLimit(sess)
1517
- if _, err := sess.Get(&cnt); err != nil {
1518
- return 0, fmt.Errorf("unable to CountIssues: %w", err)
1519
- }
1520
- return cnt, nil
+ return sess.Count()
1521
}
1522
1523
// GetParticipantsIDsByIssueID returns the IDs of all users who participated in comments of an issue,
0 commit comments