Fix: missing value for In() condition
This commit is contained in:
parent
c9854bee98
commit
33444a3308
2 changed files with 6 additions and 1 deletions
|
@ -616,7 +616,7 @@ func (issues IssueList) LoadIsRead(ctx context.Context, userID int64) error {
|
|||
issueIDs := issues.getIssueIDs()
|
||||
issueUsers := make([]*IssueUser, 0, len(issueIDs))
|
||||
if err := db.GetEngine(ctx).Where("uid =?", userID).
|
||||
In("issue_id").
|
||||
In("issue_id", issueIDs).
|
||||
Find(&issueUsers); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -72,4 +72,9 @@ func TestIssueList_LoadAttributes(t *testing.T) {
|
|||
assert.Nil(t, issue.Project)
|
||||
}
|
||||
}
|
||||
|
||||
assert.NoError(t, issueList.LoadIsRead(db.DefaultContext, 1))
|
||||
for _, issue := range issueList {
|
||||
assert.Equal(t, issue.ID == 1, issue.IsRead, "unexpected is_read value for issue[%d]", issue.ID)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue