MM-22051: Remove ToJson from model (part 1) (#18005)
https://mattermost.atlassian.net/browse/MM-22051 ```release-note Removed the following methods/functions: (ad *AccessData) ToJson() (ar *AccessResponse) ToJson() (ar *AnalyticsRow) ToJson() (ar AnalyticsRows) ToJson() (o *Audit) ToJson() (o Audits) ToJson() (ad *AuthData) ToJson() (ar *AuthorizeRequest) ToJson() (o *ChannelPatch) ToJson() (o *ChannelsWithCount) ToJson() (o *ChannelCounts) ToJson() (o *ChannelData) ToJson() (o *ChannelMembers) ToJson() (o *ChannelUnread) ToJson() (o *ChannelUnreadAt) ToJson() (o *ChannelStats) ToJson() (o *ChannelView) ToJson() (o *ChannelViewResponse) ToJson() (o *ClusterDiscovery) ToJson() (ci *ClusterInfo) ToJson() (cs *ClusterStats) ToJson() (o *Command) ToJson() CommandListToJson(l []*Command) string (o *CommandArgs) ToJson() (cmr *CommandMoveRequest) ToJson() (o *CommandResponse) ToJson() (c *Compliance) ToJson() (c Compliances) ToJson() (o *Config) ToJson() EmojiListToJson(emojiList []*Emoji) ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1ae1c38c9f
Коммит
0d075c32db
@@ -261,7 +261,9 @@ func listCommands(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
w.Write([]byte(model.CommandListToJson(commands)))
|
||||
if err := json.NewEncoder(w).Encode(commands); err != nil {
|
||||
mlog.Warn("Error writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func getCommand(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
@@ -374,7 +376,9 @@ func listAutocompleteCommands(c *Context, w http.ResponseWriter, r *http.Request
|
||||
return
|
||||
}
|
||||
|
||||
w.Write([]byte(model.CommandListToJson(commands)))
|
||||
if err := json.NewEncoder(w).Encode(commands); err != nil {
|
||||
mlog.Warn("Error while writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func listCommandAutocompleteSuggestions(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
@@ -121,7 +121,9 @@ func getEmojiList(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
w.Write([]byte(model.EmojiListToJson(listEmoji)))
|
||||
if err := json.NewEncoder(w).Encode(listEmoji); err != nil {
|
||||
mlog.Warn("Error while writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func deleteEmoji(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
@@ -270,7 +272,9 @@ func searchEmojis(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
w.Write([]byte(model.EmojiListToJson(emojis)))
|
||||
if err := json.NewEncoder(w).Encode(emojis); err != nil {
|
||||
mlog.Warn("Error while writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func autocompleteEmojis(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
@@ -287,5 +291,7 @@ func autocompleteEmojis(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
w.Write([]byte(model.EmojiListToJson(emojis)))
|
||||
if err := json.NewEncoder(w).Encode(emojis); err != nil {
|
||||
mlog.Warn("Error while writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user