From bb893fa6ba1bcd8e6a34bed9346322ee056e4a26 Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Thu, 24 Mar 2022 18:28:41 -0700 Subject: [PATCH] server: sort search results --- server/src/routes/posts.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/routes/posts.ts b/server/src/routes/posts.ts index 77ae39b4..740776f9 100644 --- a/server/src/routes/posts.ts +++ b/server/src/routes/posts.ts @@ -169,7 +169,9 @@ posts.get("/search", as: "files", attributes: ["id", "title"] } - ] + ], + attributes: ["id", "title", "visibility", "createdAt"], + order: [["createdAt", "DESC"]] }) res.json(posts)