File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -1313,15 +1313,13 @@ func (c *Comment) HasOriginalAuthor() bool {
13131313 return c .OriginalAuthor != "" && c .OriginalAuthorID != 0
13141314}
13151315
1316- func CountCommentsBuilder ( issueID int64 ) * builder. Builder {
1317- return builder .Select ("count(*)" ).From ("comment" ).Where (builder.Eq {
1316+ func UpdateIssueNumComments ( ctx context. Context , issueID int64 ) error {
1317+ countCommentsBuilder := builder .Select ("count(*)" ).From ("comment" ).Where (builder.Eq {
13181318 "issue_id" : issueID ,
13191319 }.And (builder .In ("type" , ConversationCountedCommentType ()... )))
1320- }
13211320
1322- func UpdateIssueNumComments (ctx context.Context , issueID int64 ) error {
13231321 _ , err := db .GetEngine (ctx ).
1324- SetExpr ("num_comments" , CountCommentsBuilder ( issueID ) ).
1322+ SetExpr ("num_comments" , countCommentsBuilder ).
13251323 ID (issueID ).
13261324 Update (new (Issue ))
13271325 return err
You can’t perform that action at this time.
0 commit comments