Skip to content

Commit 76c1758

Browse files
committed
add comments in code to explain
1 parent 6a25109 commit 76c1758

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

models/issue_reaction.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,14 @@ type FindReactionsOptions struct {
3434
}
3535

3636
func (opts *FindReactionsOptions) toConds() builder.Cond {
37+
//If Issue ID is set add to Query
3738
var cond = builder.NewCond()
3839
if opts.IssueID > 0 {
3940
cond = cond.And(builder.Eq{"reaction.issue_id": opts.IssueID})
4041
}
42+
//If CommentID is > 0 add to Query
43+
//If it is 0 Query ignore CommentID to select
44+
//If it is -1 it explicit search of Issue Reactions where CommentID = 0
4145
if opts.CommentID > 0 {
4246
cond = cond.And(builder.Eq{"reaction.comment_id": opts.CommentID})
4347
} else if opts.CommentID == -1 {

0 commit comments

Comments
 (0)