summaryrefslogtreecommitdiffstats
path: root/store
diff options
context:
space:
mode:
authorMARUYAMA Takayuki <maruTA-bis5@users.noreply.github.com>2016-11-29 00:26:23 +0900
committerJoram Wilander <jwawilander@gmail.com>2016-11-28 10:26:23 -0500
commit8d9768dad38701f21602e33c28091a311a63e170 (patch)
treef5f51782f70490a59067f42dbebe2209107b64cc /store
parent28b84dc1d1d0faaf822f95fca3bb03bc5172b483 (diff)
downloadchat-8d9768dad38701f21602e33c28091a311a63e170.tar.gz
chat-8d9768dad38701f21602e33c28091a311a63e170.tar.bz2
chat-8d9768dad38701f21602e33c28091a311a63e170.zip
Change Flag Posts ordering to show posts from newest to oldest (#4656)
Diffstat (limited to 'store')
-rw-r--r--store/sql_post_store.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/store/sql_post_store.go b/store/sql_post_store.go
index 51cf042b5..900aeeeb6 100644
--- a/store/sql_post_store.go
+++ b/store/sql_post_store.go
@@ -146,7 +146,7 @@ func (s SqlPostStore) GetFlaggedPosts(userId string, offset int, limit int) Stor
pl := &model.PostList{}
var posts []*model.Post
- if _, err := s.GetReplica().Select(&posts, "SELECT * FROM Posts WHERE Id IN (SELECT Name FROM Preferences WHERE UserId = :UserId AND Category = :Category) AND DeleteAt = 0 ORDER BY CreateAt ASC LIMIT :Limit OFFSET :Offset", map[string]interface{}{"UserId": userId, "Category": model.PREFERENCE_CATEGORY_FLAGGED_POST, "Offset": offset, "Limit": limit}); err != nil {
+ if _, err := s.GetReplica().Select(&posts, "SELECT * FROM Posts WHERE Id IN (SELECT Name FROM Preferences WHERE UserId = :UserId AND Category = :Category) AND DeleteAt = 0 ORDER BY CreateAt DESC LIMIT :Limit OFFSET :Offset", map[string]interface{}{"UserId": userId, "Category": model.PREFERENCE_CATEGORY_FLAGGED_POST, "Offset": offset, "Limit": limit}); err != nil {
result.Err = model.NewLocAppError("SqlPostStore.GetFlaggedPosts", "store.sql_post.get_flagged_posts.app_error", nil, err.Error())
} else {
for _, post := range posts {