forked from kevadesu/forgejo
Move login related structs and functions to models/login (#17093)
* Move login related structs and functions to models/login * Fix test * Fix lint * Fix lint * Fix lint of windows * Fix lint * Fix test * Fix test * Only load necessary fixtures when preparing unit tests envs * Fix lint * Fix test * Fix test * Fix error log * Fix error log * Fix error log * remove unnecessary change * fix error log * merge main branch
This commit is contained in:
parent
4a2655098f
commit
5842a55b31
142 changed files with 1050 additions and 907 deletions
|
@ -35,7 +35,7 @@ func init() {
|
|||
|
||||
// FindReactionsOptions describes the conditions to Find reactions
|
||||
type FindReactionsOptions struct {
|
||||
ListOptions
|
||||
db.ListOptions
|
||||
IssueID int64
|
||||
CommentID int64
|
||||
UserID int64
|
||||
|
@ -78,7 +78,7 @@ func FindCommentReactions(comment *Comment) (ReactionList, error) {
|
|||
}
|
||||
|
||||
// FindIssueReactions returns a ReactionList of all reactions from an issue
|
||||
func FindIssueReactions(issue *Issue, listOptions ListOptions) (ReactionList, error) {
|
||||
func FindIssueReactions(issue *Issue, listOptions db.ListOptions) (ReactionList, error) {
|
||||
return findReactions(db.GetEngine(db.DefaultContext), FindReactionsOptions{
|
||||
ListOptions: listOptions,
|
||||
IssueID: issue.ID,
|
||||
|
@ -92,7 +92,7 @@ func findReactions(e db.Engine, opts FindReactionsOptions) ([]*Reaction, error)
|
|||
In("reaction.`type`", setting.UI.Reactions).
|
||||
Asc("reaction.issue_id", "reaction.comment_id", "reaction.created_unix", "reaction.id")
|
||||
if opts.Page != 0 {
|
||||
e = setEnginePagination(e, &opts)
|
||||
e = db.SetEnginePagination(e, &opts)
|
||||
|
||||
reactions := make([]*Reaction, 0, opts.PageSize)
|
||||
return reactions, e.Find(&reactions)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue