@Summary patch slack connection @Description Patch slack connection @Tags plugins/slack @Param body body models.SlackConnection true "json body" @Success 200 {object} models.SlackConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Rou
(input *plugin.ApiResourceInput)
| 129 | // @Failure 500 {string} errcode.Error "Internal Error" |
| 130 | // @Router /plugins/slack/connections/{connectionId} [PATCH] |
| 131 | func PatchConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 132 | connection := &models.SlackConnection{} |
| 133 | if err := connectionHelper.First(&connection, input.Params); err != nil { |
| 134 | return nil, err |
| 135 | } |
| 136 | if err := (&models.SlackConnection{}).MergeFromRequest(connection, input.Body); err != nil { |
| 137 | return nil, errors.Convert(err) |
| 138 | } |
| 139 | if err := connectionHelper.SaveWithCreateOrUpdate(connection); err != nil { |
| 140 | return nil, err |
| 141 | } |
| 142 | return &plugin.ApiResourceOutput{Body: connection.Sanitize(), Status: http.StatusOK}, nil |
| 143 | } |
| 144 | |
| 145 | // @Summary delete a slack connection |
| 146 | // @Description Delete a slack connection |
nothing calls this directly
no test coverage detected