Implement update OAuthApp endpoint for APIv4, add test (#7413)

Этот коммит содержится в:
n1aba
2017-09-18 14:40:41 +03:00
коммит произвёл Joram Wilander
родитель 7243aa6751
Коммит 5a855e1ca1
4 изменённых файлов: 175 добавлений и 0 удалений

Просмотреть файл

@@ -2631,6 +2631,16 @@ func (c *Client4) CreateOAuthApp(app *OAuthApp) (*OAuthApp, *Response) {
}
}
// UpdateOAuthApp
func (c *Client4) UpdateOAuthApp(app *OAuthApp) (*OAuthApp, *Response) {
if r, err := c.DoApiPut(c.GetOAuthAppRoute(app.Id), app.ToJson()); err != nil {
return nil, BuildErrorResponse(r, err)
} else {
defer closeBody(r)
return OAuthAppFromJson(r.Body), BuildResponse(r)
}
}
// GetOAuthApps gets a page of registered OAuth 2.0 client applications with Mattermost acting as an OAuth 2.0 service provider.
func (c *Client4) GetOAuthApps(page, perPage int) ([]*OAuthApp, *Response) {
query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage)