diff --git a/backend/webhooks.go b/backend/webhooks.go index a4c12c0..0982125 100644 --- a/backend/webhooks.go +++ b/backend/webhooks.go @@ -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 @@ -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 diff --git a/plugin.json b/plugin.json index 9b6feed..c858ae6 100644 --- a/plugin.json +++ b/plugin.json @@ -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": {