feat(webhooks): add route to get all available webhook events
This commit is contained in:
@ -20,6 +20,7 @@ import (
|
||||
"code.vikunja.io/api/pkg/events"
|
||||
"code.vikunja.io/api/pkg/user"
|
||||
"code.vikunja.io/web"
|
||||
"sort"
|
||||
"sync"
|
||||
"time"
|
||||
"xorm.io/xorm"
|
||||
@ -71,6 +72,17 @@ func RegisterEventForWebhook(event WebhookEvent) {
|
||||
})
|
||||
}
|
||||
|
||||
func GetAvailableWebhookEvents() []string {
|
||||
evts := []string{}
|
||||
for e := range availableWebhookEvents {
|
||||
evts = append(evts, e)
|
||||
}
|
||||
|
||||
sort.Strings(evts)
|
||||
|
||||
return evts
|
||||
}
|
||||
|
||||
func (w *Webhook) Create(s *xorm.Session, a web.Auth) (err error) {
|
||||
// TODO: check valid webhook events
|
||||
w.CreatedByID = a.GetID()
|
||||
|
Reference in New Issue
Block a user