Skip to content

Commit

Permalink
chore: replace custom merge logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-ks committed May 15, 2024
1 parent 6a4e5d0 commit 7f6ee55
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions backend/plugins/azuredevops_go/api/connection_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,10 @@ func TestConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput,
// @Failure 500 {string} errcode.Error "Internal Error"
// @Router /plugins/azuredevops/connections/{connectionId}/test [POST]
func TestExistingConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) {
connection, err := dsHelper.ConnApi.FindByPk(input)
connection, err := dsHelper.ConnApi.GetMergedConnection(input)
if err != nil {
return nil, errors.BadInput.Wrap(err, "can't read connection from database")
}
var updatedConn models.AzuredevopsConn
if err := api.Decode(input.Body, &updatedConn, nil); err != nil {
return nil, err
}

if updatedConn.Token != "" {
connection.Token = updatedConn.Token
}

if updatedConn.Organization != "" {
connection.Organization = updatedConn.Organization
}

body, err := testConnection(context.TODO(), *connection)
if err != nil {
Expand Down

0 comments on commit 7f6ee55

Please sign in to comment.