MCPcopy Index your code
hub / github.com/apache/devlake / DeleteConnectionByName

Function DeleteConnectionByName

backend/plugins/webhook/api/connection.go:141–151  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

139// @Failure 500 {string} errcode.Error "Internal Error"
140// @Router /plugins/webhook/connections/by-name/{connectionName} [DELETE]
141func 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
153func deleteConnection(e error, connectionId uint64) (*plugin.ApiResourceOutput, errors.Error) {
154 if e != nil {

Callers

nothing calls this directly

Calls 4

deleteConnectionFunction · 0.85
FirstByNameMethod · 0.80
ErrorMethod · 0.65
ConnectionIdMethod · 0.65

Tested by

no test coverage detected