[MM-48029] notify admin for plugin install from work templates (#22007)

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Julien Tant <julien@craftyx.fr>
Этот коммит содержится в:
Muhammad S
2023-02-09 02:08:33 +05:00
коммит произвёл GitHub
родитель a72dd120b7
Коммит 3ae70591d0
26 изменённых файлов: 639 добавлений и 100 удалений

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

@@ -7,10 +7,13 @@ import (
"encoding/json"
"net/http"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
"github.com/mattermost/mattermost-server/v6/model"
)
func handleNotifyAdmin(c *Context, w http.ResponseWriter, r *http.Request) {
mlog.Info("enter handleNotifyAdmin")
var notifyAdminRequest *model.NotifyAdminToUpgradeRequest
err := json.NewDecoder(r.Body).Decode(&notifyAdminRequest)
if err != nil {
@@ -24,11 +27,14 @@ func handleNotifyAdmin(c *Context, w http.ResponseWriter, r *http.Request) {
c.Err = appErr
return
}
mlog.Info("exit handleNotifyAdmin")
ReturnStatusOK(w)
}
func handleTriggerNotifyAdminPosts(c *Context, w http.ResponseWriter, r *http.Request) {
mlog.Info("enter handleTriggerNotifyAdminPosts")
if !*c.App.Config().ServiceSettings.EnableAPITriggerAdminNotifications {
c.Err = model.NewAppError("Api4.handleTriggerNotifyAdminPosts", "api.cloud.app_error", nil, "Manual triggering of notifications not allowed", http.StatusForbidden)
return
@@ -53,5 +59,7 @@ func handleTriggerNotifyAdminPosts(c *Context, w http.ResponseWriter, r *http.Re
return
}
mlog.Info("exit handleTriggerNotifyAdminPosts")
ReturnStatusOK(w)
}