File tree Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -1510,20 +1510,10 @@ func Issues(opts *IssuesOptions) ([]*Issue, error) {
15101510func CountIssues (opts * IssuesOptions ) (int64 , error ) {
15111511 e := db .GetEngine (db .DefaultContext )
15121512
1513- countsSlice := make ([]* struct {
1514- Count int64
1515- }, 0 , 1 )
1516-
15171513 sess := e .Select ("COUNT(issue.id) AS count" ).Table ("issue" )
15181514 sess .Join ("INNER" , "repository" , "`issue`.repo_id = `repository`.id" )
15191515 opts .setupSessionNoLimit (sess )
1520- if err := sess .Find (& countsSlice ); err != nil {
1521- return 0 , fmt .Errorf ("unable to CountIssues: %w" , err )
1522- }
1523- if len (countsSlice ) != 1 {
1524- return 0 , fmt .Errorf ("unable to get one row result when CountIssues, row count=%d" , len (countsSlice ))
1525- }
1526- return countsSlice [0 ].Count , nil
1516+ return sess .Count ()
15271517}
15281518
15291519// GetParticipantsIDsByIssueID returns the IDs of all users who participated in comments of an issue,
You can’t perform that action at this time.
0 commit comments