Files
mattermost/api4/data_retention.go
Chris 91bfc72a99 Reduce logging data races, fix MySQL test race condition (#7994)
* fix races

* revert unintentional change

* fix test as intended
2017-12-22 12:09:33 +00:00

25 lines
532 B
Go

// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package api4
import (
"net/http"
)
func (api *API) InitDataRetention() {
api.BaseRoutes.DataRetention.Handle("/policy", api.ApiSessionRequired(getPolicy)).Methods("GET")
}
func getPolicy(c *Context, w http.ResponseWriter, r *http.Request) {
// No permission check required.
if policy, err := c.App.GetDataRetentionPolicy(); err != nil {
c.Err = err
return
} else {
w.Write([]byte(policy.ToJson()))
}
}