瀏覽代碼

Commit 7-8: Sort posts by submitted timestamp.

Frederic G. MARAND 9 年之前
父節點
當前提交
ce3568ed04
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      client/templates/posts/posts_list.js

+ 1 - 1
client/templates/posts/posts_list.js

@@ -8,7 +8,7 @@
  */
 Template.postsList.helpers({
   posts: function () {
-    return Posts.find();
+    return Posts.find({}, { sort: { submitted: -1 }});
   }
 });