Add updateConfig endpoint for apiV4 (#5706)
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
9b10f3ef54
Коммит
ac8282cda1
@@ -1191,6 +1191,7 @@ func (c *Client4) DatabaseRecycle() (bool, *Response) {
|
||||
}
|
||||
}
|
||||
|
||||
// InvalidateCaches will purge the cache and can affect the performance while is cleaning.
|
||||
func (c *Client4) InvalidateCaches() (bool, *Response) {
|
||||
if r, err := c.DoApiPost(c.GetCacheRoute()+"/invalidate", ""); err != nil {
|
||||
return false, &Response{StatusCode: r.StatusCode, Error: err}
|
||||
@@ -1200,6 +1201,16 @@ func (c *Client4) InvalidateCaches() (bool, *Response) {
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateConfig will update the server configuration
|
||||
func (c *Client4) UpdateConfig(config *Config) (*Config, *Response) {
|
||||
if r, err := c.DoApiPut(c.GetConfigRoute(), config.ToJson()); err != nil {
|
||||
return nil, &Response{StatusCode: r.StatusCode, Error: err}
|
||||
} else {
|
||||
defer closeBody(r)
|
||||
return ConfigFromJson(r.Body), BuildResponse(r)
|
||||
}
|
||||
}
|
||||
|
||||
// Webhooks Section
|
||||
|
||||
// CreateIncomingWebhook creates an incoming webhook for a channel.
|
||||
|
||||
Ссылка в новой задаче
Block a user