@Summary patch gitee connection @Description Patch gitee connection @Tags plugins/gitee @Param body body models.GiteeConnection true "json body" @Success 200 {object} models.GiteeConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Rou
(input *plugin.ApiResourceInput)
| 146 | // @Failure 500 {string} errcode.Error "Internal Error" |
| 147 | // @Router /plugins/gitee/connections/{connectionId} [PATCH] |
| 148 | func PatchConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 149 | connection := &models.GiteeConnection{} |
| 150 | if err := connectionHelper.First(&connection, input.Params); err != nil { |
| 151 | return nil, err |
| 152 | } |
| 153 | if err := (&models.GiteeConnection{}).MergeFromRequest(connection, input.Body); err != nil { |
| 154 | return nil, errors.Convert(err) |
| 155 | } |
| 156 | if err := connectionHelper.SaveWithCreateOrUpdate(connection); err != nil { |
| 157 | return nil, err |
| 158 | } |
| 159 | return &plugin.ApiResourceOutput{Body: connection.Sanitize(), Status: http.StatusOK}, nil |
| 160 | } |
| 161 | |
| 162 | // @Summary delete a gitee connection |
| 163 | // @Description Delete a gitee connection |
nothing calls this directly
no test coverage detected