mirror of https://github.com/go-gitea/gitea
Fix list options
This commit is contained in:
parent
0e61648d23
commit
87ef8b75b1
|
@ -53,9 +53,12 @@ func ListActionTasks(ctx *context.APIContext) {
|
|||
// "$ref": "#/responses/error"
|
||||
// "422":
|
||||
// "$ref": "#/responses/validationError"
|
||||
opts := utils.GetListOptions(ctx)
|
||||
|
||||
tasks, total, err := db.FindAndCount[actions_model.ActionTask](ctx, opts)
|
||||
tasks, total, err := db.FindAndCount[actions_model.ActionTask](ctx, &actions_model.FindTaskOptions{
|
||||
ListOptions: utils.GetListOptions(ctx),
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "ListActionTasks", err)
|
||||
return
|
||||
|
|
|
@ -25,6 +25,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/container"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
api "code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
"code.gitea.io/gitea/services/gitdiff"
|
||||
|
@ -200,6 +201,8 @@ func ToActionTask(ctx context.Context, repo *repo_model.Repository, t *actions_m
|
|||
panic(fmt.Sprintf("failed to execute ActionTask.LoadAttributes(): %v", err))
|
||||
}
|
||||
|
||||
url := fmt.Sprintf("%s%s", setting.AppURL, t.GetRunLink())
|
||||
|
||||
return &api.ActionTask{
|
||||
ID: t.ID,
|
||||
Name: t.Job.Name,
|
||||
|
@ -210,7 +213,7 @@ func ToActionTask(ctx context.Context, repo *repo_model.Repository, t *actions_m
|
|||
DisplayTitle: t.Job.Run.Title,
|
||||
Status: t.Status.String(),
|
||||
WorkflowID: t.Job.Run.WorkflowID,
|
||||
URL: t.GetRunLink(),
|
||||
URL: url,
|
||||
CreatedAt: t.Created.AsLocalTime(),
|
||||
UpdatedAt: t.Updated.AsLocalTime(),
|
||||
RunStartedAt: t.Started.AsLocalTime(),
|
||||
|
|
Loading…
Reference in New Issue