@Summary patch feishu connection @Description Patch feishu connection @Tags plugins/feishu @Param body body models.FeishuConnection true "json body" @Success 200 {object} models.FeishuConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error"
(input *plugin.ApiResourceInput)
| 129 | // @Failure 500 {string} errcode.Error "Internal Error" |
| 130 | // @Router /plugins/feishu/connections/{connectionId} [PATCH] |
| 131 | func PatchConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 132 | connection := &models.FeishuConnection{} |
| 133 | if err := connectionHelper.First(&connection, input.Params); err != nil { |
| 134 | return nil, err |
| 135 | } |
| 136 | if err := (&models.FeishuConnection{}).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 feishu connection |
| 146 | // @Description Delete a feishu connection |
nothing calls this directly
no test coverage detected