DeleteConnectionByName @Summary delete a webhook connection by name @Description Delete a webhook connection @Tags plugins/webhook @Success 200 {object} models.WebhookConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 409 {object} services.BlueprintProjectPairs "References exis
(input *plugin.ApiResourceInput)
| 139 | // @Failure 500 {string} errcode.Error "Internal Error" |
| 140 | // @Router /plugins/webhook/connections/by-name/{connectionName} [DELETE] |
| 141 | func DeleteConnectionByName(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 142 | connection := &models.WebhookConnection{} |
| 143 | err := connectionHelper.FirstByName(connection, input.Params) |
| 144 | |
| 145 | if err != nil { |
| 146 | logger.Error(err, "query connection") |
| 147 | return nil, err |
| 148 | } |
| 149 | |
| 150 | return deleteConnection(nil, connection.ConnectionId()) |
| 151 | } |
| 152 | |
| 153 | func deleteConnection(e error, connectionId uint64) (*plugin.ApiResourceOutput, errors.Error) { |
| 154 | if e != nil { |
nothing calls this directly
no test coverage detected