MM-25563: Add endpoint to fetch only archived channels (#15031)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
29c8b58fc7
Коммит
77f7a97bee
@@ -854,7 +854,17 @@ func getChannelsForTeamForUser(c *Context, w http.ResponseWriter, r *http.Reques
|
||||
return
|
||||
}
|
||||
|
||||
channels, err := c.App.GetChannelsForUser(c.Params.TeamId, c.Params.UserId, c.Params.IncludeDeleted)
|
||||
query := r.URL.Query()
|
||||
lastDeleteAt, nErr := strconv.Atoi(query.Get("last_delete_at"))
|
||||
if nErr != nil {
|
||||
lastDeleteAt = 0
|
||||
}
|
||||
if lastDeleteAt < 0 {
|
||||
c.SetInvalidUrlParam("last_delete_at")
|
||||
return
|
||||
}
|
||||
|
||||
channels, err := c.App.GetChannelsForUser(c.Params.TeamId, c.Params.UserId, c.Params.IncludeDeleted, lastDeleteAt)
|
||||
if err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
@@ -2047,7 +2057,7 @@ func updateCategoriesForTeamForUser(c *Context, w http.ResponseWriter, r *http.R
|
||||
}
|
||||
|
||||
func validateUserChannels(operationName string, c *Context, teamId, userId string, channelIDs []string) *model.AppError {
|
||||
channels, err := c.App.GetChannelsForUser(teamId, userId, false)
|
||||
channels, err := c.App.GetChannelsForUser(teamId, userId, false, 0)
|
||||
if err != nil {
|
||||
return model.NewAppError("Api4."+operationName, "api.invalid_channel", nil, err.Error(), http.StatusBadRequest)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user