From 23ae7cd2e51e2fbf69df7eaa107fccff8295f46b Mon Sep 17 00:00:00 2001 From: Dwayne Harris Date: Mon, 28 Oct 2019 19:47:31 -0400 Subject: [PATCH] WIP --- src/plugins/api/posts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/api/posts.ts b/src/plugins/api/posts.ts index 8e3eb65..671e7c0 100644 --- a/src/plugins/api/posts.ts +++ b/src/plugins/api/posts.ts @@ -267,7 +267,7 @@ function postsByUserRoute(server: FastifyInstance 0) return unauthorizedError(reply) } - const userPostsQuery = createQuerySpec(`SELECT p.id, p.postId FROM Users p WHERE p.pk = @user AND p.t = @type`, { user: id, type: UserItemType.Post }) + const userPostsQuery = createQuerySpec(`SELECT p.id, p.postId FROM Users p WHERE p.pk = @user AND p.t = @type ORDER BY p.created DESC`, { user: id, type: UserItemType.Post }) const userPosts = await queryItems({ container: userContainer, query: userPostsQuery,