diff options
Diffstat (limited to 'models/webhook.go')
-rw-r--r-- | models/webhook.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/models/webhook.go b/models/webhook.go index 5acc83f5..5c0e2179 100644 --- a/models/webhook.go +++ b/models/webhook.go @@ -99,7 +99,7 @@ func GetWebhookById(hookId int64) (*Webhook, error) { // GetActiveWebhooksByRepoId returns all active webhooks of repository. func GetActiveWebhooksByRepoId(repoId int64) (ws []*Webhook, err error) { - err = x.Find(&ws, &Webhook{RepoId: repoId, IsActive: true}) + err = x.Where("repo_id=?", repoId).And("is_active=?", true).Find(&ws) return ws, err } @@ -129,7 +129,7 @@ func GetWebhooksByOrgId(orgId int64) (ws []*Webhook, err error) { // GetActiveWebhooksByOrgId returns all active webhooks for an organization. func GetActiveWebhooksByOrgId(orgId int64) (ws []*Webhook, err error) { - err = x.Find(&ws, &Webhook{OrgId: orgId, IsActive: true}) + err = x.Where("org_id=?", orgId).And("is_active=?", true).Find(&ws) return ws, err } @@ -230,7 +230,7 @@ func CreateHookTask(t *HookTask) error { // UpdateHookTask updates information of hook task. func UpdateHookTask(t *HookTask) error { - _, err := x.AllCols().Update(t) + _, err := x.Id(t.Id).AllCols().Update(t) return err } |