Quick fix for /posts/forUser post ordering
commitec69be5460fc20cb90b65e7acb220d2dfc06346f
authoriko <ilyakooo0@gmail.com>
dateSun 24 Feb 2019, 22:23 (8 years ago)
parent9a068b9
denis/package.yaml+2−3
@@ -27,9 +27,8 @@ dependencies:
2727- text
2828- aeson
2929- bytestring
30−- http-client
31−- http-client-tls
32−- stm
30+# - http-client
31+# - http-client-tls
3332- servant-websockets
3433- websockets
3534- squeal-postgresql
denis/src/Data/Query.hs+1
@@ -142,6 +142,7 @@ getPostsForUserLimitingQ :: Word64 -> Query Schema (TuplePG (Only UserId)) (RowP
142142getPostsForUserLimitingQ lim = select (#postRowId `as` #fromOnly) $
143143 (from $ table #posts) &
144144 where_ (#postRowAuthorId .== param @1) &
145+ orderBy [#postRowId & Desc] &
145146 limit lim
146147
147148getPostsForUser :: Word64 -> UserId -> StaticPQ [Post]