Mm 43609 (#20657)
* return first inaccessible post time instead of has inaccessible posts
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
478ff50ffd
Коммит
77881fc357
@@ -401,7 +401,7 @@ func getPost(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// Post is inaccessible due to cloud plan's limit.
|
||||
if err.Id == "app.post.cloud.get.app_error" {
|
||||
w.Header().Set(model.HeaderHasInaccessiblePosts, "true")
|
||||
w.Header().Set(model.HeaderFirstInaccessiblePostTime, "1")
|
||||
}
|
||||
|
||||
return
|
||||
@@ -438,7 +438,7 @@ func getPostsByIds(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
postsList, hasInaccessiblePosts, err := c.App.GetPostsByIds(postIDs)
|
||||
postsList, firstInaccessiblePostTime, err := c.App.GetPostsByIds(postIDs)
|
||||
if err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
@@ -471,7 +471,7 @@ func getPostsByIds(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
posts = append(posts, post)
|
||||
}
|
||||
|
||||
w.Header().Set(model.HeaderHasInaccessiblePosts, strconv.FormatBool(hasInaccessiblePosts))
|
||||
w.Header().Set(model.HeaderFirstInaccessiblePostTime, strconv.FormatInt(firstInaccessiblePostTime, 10))
|
||||
|
||||
if err := json.NewEncoder(w).Encode(posts); err != nil {
|
||||
mlog.Warn("Error while writing response", mlog.Err(err))
|
||||
|
||||
Ссылка в новой задаче
Block a user