mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
#3383 code cleanup
This commit is contained in:
@@ -210,15 +210,18 @@ func GetWebhookByOrgID(orgID, id int64) (*Webhook, error) {
|
||||
}
|
||||
|
||||
// GetActiveWebhooksByRepoID returns all active webhooks of repository.
|
||||
func GetActiveWebhooksByRepoID(repoID int64) (ws []*Webhook, err error) {
|
||||
err = x.Where("repo_id=?", repoID).And("is_active=?", true).Find(&ws)
|
||||
return ws, err
|
||||
func GetActiveWebhooksByRepoID(repoID int64) ([]*Webhook, error) {
|
||||
webhooks := make([]*Webhook, 0, 5)
|
||||
return webhooks, x.Find(&webhooks, &Webhook{
|
||||
RepoID: repoID,
|
||||
IsActive: true,
|
||||
})
|
||||
}
|
||||
|
||||
// GetWebhooksByRepoID returns all webhooks of repository.
|
||||
func GetWebhooksByRepoID(repoID int64) (ws []*Webhook, err error) {
|
||||
err = x.Find(&ws, &Webhook{RepoID: repoID})
|
||||
return ws, err
|
||||
// GetWebhooksByRepoID returns all webhooks of a repository.
|
||||
func GetWebhooksByRepoID(repoID int64) ([]*Webhook, error) {
|
||||
webhooks := make([]*Webhook, 0, 5)
|
||||
return webhooks, x.Find(&webhooks, &Webhook{RepoID: repoID})
|
||||
}
|
||||
|
||||
// UpdateWebhook updates information of webhook.
|
||||
|
Reference in New Issue
Block a user