Skip to content

Commit aca3361

Browse files
committed
Fix test
1 parent 913f0cb commit aca3361

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

models/issues/comment.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)