Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix(api): find webhook (#5064)

h3n4l85184f258330
diff --git a/backend/server/project_webhook.go b/backend/server/project_webhook.go
index 6e22a3d083..ccd3777d51 100644
--- a/backend/server/project_webhook.go
+++ b/backend/server/project_webhook.go
@@ -65,7 +65,12 @@ func (s *Server) registerProjectWebhookRoutes(g *echo.Group) {
return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Project ID not found: %v", projectID))
}
- webhook, err := s.store.CreateProjectWebhookV2(ctx, c.Get(getPrincipalIDContextKey()).(int), projectID, project.ResourceID, &store.ProjectWebhookMessage{})
+ webhook, err := s.store.CreateProjectWebhookV2(ctx, c.Get(getPrincipalIDContextKey()).(int), projectID, project.ResourceID, &store.ProjectWebhookMessage{
+ Type: hookCreate.Type,
+ Title: hookCreate.Name,
+ URL: hookCreate.URL,
+ ActivityList: hookCreate.ActivityList,
+ })
if err != nil {
if common.ErrorCode(err) == common.Conflict {
return echo.NewHTTPError(http.StatusConflict, fmt.Sprintf("Webhook url already exists in the project: %s", hookCreate.URL))
diff --git a/backend/store/project_webhook.go b/backend/store/project_webhook.go
index 82a4cc6110..bc70cfbba1 100644
--- a/backend/store/project_webhook.go
+++ b/backend/store/project_webhook.go
@@ -38,6 +38,7 @@ func (p *ProjectWebhookMessage) ToAPIProjectWebhook() *api.ProjectWebhook {
Type: p.Type,
URL: p.URL,
ActivityList: p.ActivityList,
+ Name: p.Title,
}
}