Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions backend/webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ func (p *webhookPlugin) listWebhooks(req *plugin.Request, res *plugin.Response)
func (p *webhookPlugin) createWebhook(req *plugin.Request, res *plugin.Response) {
projectID := req.PathParam("projectId")

type body struct {
type createWebhookBody struct {
URL string `json:"url"`
Secret string `json:"secret"`
Events []string `json:"events"`
}
b, err := plugin.JSONBody[body](req)
b, err := plugin.JSONBody[createWebhookBody](req)
if err != nil {
apiError(res, 400, "BAD_REQUEST", "invalid request body")
return
Expand Down Expand Up @@ -262,13 +262,13 @@ func (p *webhookPlugin) updateWebhook(req *plugin.Request, res *plugin.Response)
return
}

type body struct {
type updateWebhookBody struct {
URL *string `json:"url"`
Secret *string `json:"secret"`
Events []string `json:"events"`
Enabled *bool `json:"enabled"`
}
b, err := plugin.JSONBody[body](req)
b, err := plugin.JSONBody[updateWebhookBody](req)
if err != nil {
apiError(res, 400, "BAD_REQUEST", "invalid request body")
return
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "com.paca.webhook",
"displayName": "Webhooks",
"description": "Sends HTTP webhooks to a URL of your choice when task activity happens in a project.",
"version": "0.1.8",
"version": "0.1.9",
"minCoreVersion": "v0.13.3",
"permissions": ["db.read", "db.write", "events.subscribe"],
"backend": {
Expand Down
Loading