PLT-4938 Add app package and move logic over from api package (#4931)
* Add app package and move logic over from api package * Change app package functions to return errors * Move non-api tests into app package * Fix merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
07bad4d6d5
Коммит
97558f6a6e
@@ -6,6 +6,7 @@ package api
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/mattermost/platform/app"
|
||||
"github.com/mattermost/platform/model"
|
||||
)
|
||||
|
||||
@@ -67,13 +68,13 @@ func setCollapsePreference(c *Context, isCollapse bool) *model.CommandResponse {
|
||||
Value: strconv.FormatBool(isCollapse),
|
||||
}
|
||||
|
||||
if result := <-Srv.Store.Preference().Save(&model.Preferences{pref}); result.Err != nil {
|
||||
if result := <-app.Srv.Store.Preference().Save(&model.Preferences{pref}); result.Err != nil {
|
||||
return &model.CommandResponse{Text: c.T("api.command_expand_collapse.fail.app_error"), ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
|
||||
}
|
||||
|
||||
socketMessage := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_PREFERENCE_CHANGED, "", "", c.Session.UserId, nil)
|
||||
socketMessage.Add("preference", pref.ToJson())
|
||||
go Publish(socketMessage)
|
||||
go app.Publish(socketMessage)
|
||||
|
||||
var rmsg string
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user