Files
hearth/package/gitea/source/models/actions/schedule_list.go
T
yukkop d9b2a4e787
runner nix smoke / nix label and flake smoke (push) Failing after 1m28s
feat: update gitea vendor
2026-09-26 21:18:24 +00:00

35 lines
619 B
Go

// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package actions
import (
"gitea.dev/models/db"
"xorm.io/builder"
)
type ScheduleList []*ActionSchedule
type FindScheduleOptions struct {
db.ListOptions
RepoID int64
OwnerID int64
}
func (opts FindScheduleOptions) ToConds() builder.Cond {
cond := builder.NewCond()
if opts.RepoID > 0 {
cond = cond.And(builder.Eq{"repo_id": opts.RepoID})
}
if opts.OwnerID > 0 {
cond = cond.And(builder.Eq{"owner_id": opts.OwnerID})
}
return cond
}
func (opts FindScheduleOptions) ToOrders() string {
return "`id` DESC"
}