[GH-28355] Fixed errcheck issues in server/channels/api4/channel_category.go (#28357)
Этот коммит содержится в:
@@ -63,7 +63,6 @@ issues:
|
||||
channels/api4/bot_test.go|\
|
||||
channels/api4/brand.go|\
|
||||
channels/api4/channel.go|\
|
||||
channels/api4/channel_category.go|\
|
||||
channels/api4/channel_test.go|\
|
||||
channels/api4/cloud.go|\
|
||||
channels/api4/cloud_test.go|\
|
||||
|
||||
@@ -35,7 +35,9 @@ func getCategoriesForTeamForUser(c *Context, w http.ResponseWriter, r *http.Requ
|
||||
return
|
||||
}
|
||||
|
||||
w.Write(categoriesJSON)
|
||||
if _, err := w.Write(categoriesJSON); err != nil {
|
||||
c.Logger.Warn("Error while writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func createCategoryForTeamForUser(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
@@ -78,7 +80,9 @@ func createCategoryForTeamForUser(c *Context, w http.ResponseWriter, r *http.Req
|
||||
|
||||
auditRec.Success()
|
||||
|
||||
w.Write(categoryJSON)
|
||||
if _, err := w.Write(categoryJSON); err != nil {
|
||||
c.Logger.Warn("Error while writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func getCategoryOrderForTeamForUser(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
@@ -138,7 +142,10 @@ func updateCategoryOrderForTeamForUser(c *Context, w http.ResponseWriter, r *htt
|
||||
}
|
||||
|
||||
auditRec.Success()
|
||||
w.Write([]byte(model.ArrayToJSON(categoryOrder)))
|
||||
|
||||
if _, err := w.Write([]byte(model.ArrayToJSON(categoryOrder))); err != nil {
|
||||
c.Logger.Warn("Error while writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func getCategoryForTeamForUser(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
@@ -164,7 +171,9 @@ func getCategoryForTeamForUser(c *Context, w http.ResponseWriter, r *http.Reques
|
||||
return
|
||||
}
|
||||
|
||||
w.Write(categoriesJSON)
|
||||
if _, err := w.Write(categoriesJSON); err != nil {
|
||||
c.Logger.Warn("Error while writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func updateCategoriesForTeamForUser(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
@@ -213,7 +222,9 @@ func updateCategoriesForTeamForUser(c *Context, w http.ResponseWriter, r *http.R
|
||||
}
|
||||
|
||||
auditRec.Success()
|
||||
w.Write(categoriesJSON)
|
||||
if _, err := w.Write(categoriesJSON); err != nil {
|
||||
c.Logger.Warn("Error while writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func validateSidebarCategory(c *Context, teamId, userId string, category *model.SidebarCategoryWithChannels) *model.AppError {
|
||||
@@ -309,7 +320,9 @@ func updateCategoryForTeamForUser(c *Context, w http.ResponseWriter, r *http.Req
|
||||
}
|
||||
|
||||
auditRec.Success()
|
||||
w.Write(categoryJSON)
|
||||
if _, err := w.Write(categoryJSON); err != nil {
|
||||
c.Logger.Warn("Error while writing response", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
func deleteCategoryForTeamForUser(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Ссылка в новой задаче
Block a user