mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 04:10:20 +08:00
Make webhook work.
This commit is contained in:
@ -30,7 +30,7 @@ type Webhook struct {
|
||||
ContentType string `xorm:"varchar(100)" json:"contentType"`
|
||||
Events []string `xorm:"varchar(100)" json:"events"`
|
||||
|
||||
Organization string `xorm:"varchar(100)" json:"organization"`
|
||||
Organization string `xorm:"varchar(100) index" json:"organization"`
|
||||
}
|
||||
|
||||
func GetWebhookCount(owner string) int {
|
||||
@ -62,6 +62,16 @@ func GetPaginationWebhooks(owner string, offset, limit int) []*Webhook {
|
||||
return webhooks
|
||||
}
|
||||
|
||||
func getWebhooksByOrganization(organization string) []*Webhook {
|
||||
webhooks := []*Webhook{}
|
||||
err := adapter.Engine.Desc("created_time").Find(&webhooks, &Webhook{Organization: organization})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return webhooks
|
||||
}
|
||||
|
||||
func getWebhook(owner string, name string) *Webhook {
|
||||
if owner == "" || name == "" {
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user