Skip to content

Commit

Permalink
fix(webhooks): add missing /by-name prefix to new endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigoluizs committed Nov 19, 2024
1 parent 7fa4bf7 commit 25e484d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/plugins/webhook/api/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/webhook/api/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions backend/plugins/webhook/api/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 25e484d

Please sign in to comment.