Add query parameters to get posts v4 endpoint (#5858)
* Add since query paremeter to get posts v4 endpoint * Add query paremeters for before/after to get posts v4 endpoint
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
28a78d7607
Коммит
69fb47b88b
16
app/post.go
16
app/post.go
@@ -395,6 +395,22 @@ func GetPermalinkPost(postId string, userId string, siteURL string) (*model.Post
|
||||
}
|
||||
}
|
||||
|
||||
func GetPostsBeforePost(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError) {
|
||||
if result := <-Srv.Store.Post().GetPostsBefore(channelId, postId, perPage, page*perPage); result.Err != nil {
|
||||
return nil, result.Err
|
||||
} else {
|
||||
return result.Data.(*model.PostList), nil
|
||||
}
|
||||
}
|
||||
|
||||
func GetPostsAfterPost(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError) {
|
||||
if result := <-Srv.Store.Post().GetPostsAfter(channelId, postId, perPage, page*perPage); result.Err != nil {
|
||||
return nil, result.Err
|
||||
} else {
|
||||
return result.Data.(*model.PostList), nil
|
||||
}
|
||||
}
|
||||
|
||||
func GetPostsAroundPost(postId, channelId string, offset, limit int, before bool) (*model.PostList, *model.AppError) {
|
||||
var pchan store.StoreChannel
|
||||
if before {
|
||||
|
||||
Ссылка в новой задаче
Block a user