Browse Source

Sort recipes alphabetically

Lee Morgan 1 tháng trước cách đây
mục cha
commit
0ab8453b96
1 tập tin đã thay đổi với 3 bổ sung và 2 xóa
  1. 3 2
      src/routes/dashboard/+page.server.js

+ 3 - 2
src/routes/dashboard/+page.server.js

@@ -10,7 +10,8 @@ export async function load({cookies}){
             id: {$toString: "$_id"},
             name: 1,
             updatedAt: 1
-        }}
-    ]);
+        }},
+        {$sort: {name: 1}}
+    ]).collation({locale: "en", strength: 2});
     return {recipes};
 }