From 25e484d10fa1cc6988c56970b36748e19375bdee Mon Sep 17 00:00:00 2001 From: Rodrigo Silva Date: Tue, 19 Nov 2024 17:44:22 +0100 Subject: [PATCH] fix(webhooks): add missing /by-name prefix to new endpoints --- backend/plugins/webhook/api/connection.go | 2 +- backend/plugins/webhook/api/deployments.go | 2 +- backend/plugins/webhook/api/issues.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/plugins/webhook/api/connection.go b/backend/plugins/webhook/api/connection.go index aed4d3e06fc..6351c1f0c69 100644 --- a/backend/plugins/webhook/api/connection.go +++ b/backend/plugins/webhook/api/connection.go @@ -105,7 +105,7 @@ func PatchConnectionById(input *plugin.ApiResourceInput) (*plugin.ApiResourceOut // @Success 200 {object} models.WebhookConnection // @Failure 400 {string} errcode.Error "Bad Request" // @Failure 500 {string} errcode.Error "Internal Error" -// @Router /plugins/webhook/connections/{connectionId} [PATCH] +// @Router /plugins/webhook/connections/by-name/{connectionId} [PATCH] func PatchConnectionByName(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { connection := &models.WebhookConnection{} err := connectionHelper.PatchByName(connection, input) diff --git a/backend/plugins/webhook/api/deployments.go b/backend/plugins/webhook/api/deployments.go index 31502de5c14..1f4e0e0fcb2 100644 --- a/backend/plugins/webhook/api/deployments.go +++ b/backend/plugins/webhook/api/deployments.go @@ -100,7 +100,7 @@ func PostDeploymentsById(input *plugin.ApiResourceInput) (*plugin.ApiResourceOut // @Failure 400 {string} errcode.Error "Bad Request" // @Failure 403 {string} errcode.Error "Forbidden" // @Failure 500 {string} errcode.Error "Internal Error" -// @Router /plugins/webhook/connections/:connectionId/deployments [POST] +// @Router /plugins/webhook/connections/by-name/:connectionName/deployments [POST] func PostDeploymentsByName(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { connection := &models.WebhookConnection{} err := connectionHelper.FirstByName(connection, input.Params) diff --git a/backend/plugins/webhook/api/issues.go b/backend/plugins/webhook/api/issues.go index 825b4ec5fd6..81fa2d0b9be 100644 --- a/backend/plugins/webhook/api/issues.go +++ b/backend/plugins/webhook/api/issues.go @@ -105,7 +105,7 @@ func PostIssueById(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, e // @Success 200 {string} noResponse "" // @Failure 400 {string} errcode.Error "Bad Request" // @Failure 500 {string} errcode.Error "Internal Error" -// @Router /plugins/webhook/:connectionName/issues [POST] +// @Router /plugins/webhook/by-name/:connectionName/issues [POST] func PostIssueByName(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { connection := &models.WebhookConnection{} err := connectionHelper.FirstByName(connection, input.Params) @@ -241,7 +241,7 @@ func CloseIssueById(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, // @Success 200 {string} noResponse "" // @Failure 400 {string} errcode.Error "Bad Request" // @Failure 500 {string} errcode.Error "Internal Error" -// @Router /plugins/webhook/:connectionName/issue/:issueKey/close [POST] +// @Router /plugins/webhook/by-name/:connectionName/issue/:issueKey/close [POST] func CloseIssueByName(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { connection := &models.WebhookConnection{} err := connectionHelper.FirstByName(connection, input.Params)