feat(webhooks): add routes

This commit is contained in:
kolaente 2023-09-13 21:38:26 +02:00
parent c5de41f183
commit 7f3c300240
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 11 additions and 0 deletions

View File

@ -574,6 +574,17 @@ func registerAPIRoutes(a *echo.Group) {
a.GET("/tokens", apiTokenProvider.ReadAllWeb)
a.PUT("/tokens", apiTokenProvider.CreateWeb)
a.DELETE("/tokens/:token", apiTokenProvider.DeleteWeb)
// Webhooks
webhookProvider := &handler.WebHandler{
EmptyStruct: func() handler.CObject {
return &models.Webhook{}
},
}
a.GET("/project/:project/webhooks", webhookProvider.ReadAllWeb)
a.PUT("/project/:project/webhooks", webhookProvider.CreateWeb)
a.DELETE("/project/:project/webhooks/:webhook", webhookProvider.DeleteWeb)
a.POST("/project/:project/webhooks/:webhook", webhookProvider.UpdateWeb)
}
func registerMigrations(m *echo.Group) {