MM-27258 Cannot update categories with deleted channels (#15109)

Этот коммит содержится в:
Harrison Healey
2020-07-27 17:03:25 -04:00
коммит произвёл GitHub
родитель c511042c0f
Коммит 93dc68873a
2 изменённых файлов: 32 добавлений и 5 удалений

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

@@ -2056,8 +2056,10 @@ func updateCategoriesForTeamForUser(c *Context, w http.ResponseWriter, r *http.R
w.Write(model.SidebarCategoriesWithChannelsToJson(categories))
}
// validateUserChannels confirms that the given user is a member of the given channel IDs. Returns an error if the user
// is not a member of any channel or nil if the user is a member of each channel.
func validateUserChannels(operationName string, c *Context, teamId, userId string, channelIDs []string) *model.AppError {
channels, err := c.App.GetChannelsForUser(teamId, userId, false, 0)
channels, err := c.App.GetChannelsForUser(teamId, userId, true, 0)
if err != nil {
return model.NewAppError("Api4."+operationName, "api.invalid_channel", nil, err.Error(), http.StatusBadRequest)
}