summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 {