mirror of
https://github.com/go-gitea/gitea
synced 2024-11-05 09:44:26 +00:00
move to db.find
This commit is contained in:
parent
2c8249ba1e
commit
1028eefe48
@ -54,7 +54,7 @@ func ListActionTasks(ctx *context.APIContext) {
|
||||
Status: actions_model.StatusUnknown, // Unknown means all
|
||||
IDOrderDesc: true,
|
||||
}
|
||||
tasks, err := actions_model.FindTasks(ctx, opts)
|
||||
tasks, err := db.Find[actions_model.ActionTask](ctx, opts)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "ListActionTasks", err)
|
||||
return
|
||||
@ -72,7 +72,7 @@ func ListActionTasks(ctx *context.APIContext) {
|
||||
Status: actions_model.StatusUnknown, // Unknown means all
|
||||
IDOrderDesc: true,
|
||||
}
|
||||
res.TotalCount, err = actions_model.CountTasks(ctx, opts)
|
||||
tasks, res.TotalCount, err = db.FindAndCount[actions_model.ActionTask](ctx, opts)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "ListActionTasks", err)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user