mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-26 21:53:44 +00:00
fix(db): make paginated database reads always require "order" option (#39017)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -291,6 +291,10 @@ type ListWebhookOptions struct {
|
||||
IsActive optional.Option[bool]
|
||||
}
|
||||
|
||||
func (opts ListWebhookOptions) ToOrders() string {
|
||||
return "id"
|
||||
}
|
||||
|
||||
func (opts ListWebhookOptions) ToConds() builder.Cond {
|
||||
cond := builder.NewCond()
|
||||
if opts.RepoID != 0 {
|
||||
|
||||
@@ -20,6 +20,10 @@ type ListSystemWebhookOptions struct {
|
||||
IsSystem optional.Option[bool]
|
||||
}
|
||||
|
||||
func (opts ListSystemWebhookOptions) ToOrders() string {
|
||||
return "id"
|
||||
}
|
||||
|
||||
func (opts ListSystemWebhookOptions) ToConds() builder.Cond {
|
||||
cond := builder.NewCond()
|
||||
cond = cond.And(builder.Eq{"webhook.repo_id": 0}, builder.Eq{"webhook.owner_id": 0})
|
||||
|
||||
Reference in New Issue
Block a user