on master help sign in
Quick fix for /posts/forUser post ordering
ec69be5iko
denis/package.yaml+2−3
@@ -27,9 +27,8 @@ dependencies:
27- text
27- text
28- aeson
28- aeson
29- bytestring
29- bytestring
30−- http-client
30+# - http-client
31−- http-client-tls
31+# - http-client-tls
32−- stm
33- servant-websockets
32- servant-websockets
34- websockets
33- websockets
35- squeal-postgresql
34- squeal-postgresql
denis/src/Data/Query.hs+1
@@ -142,6 +142,7 @@ getPostsForUserLimitingQ :: Word64 -> Query Schema (TuplePG (Only UserId)) (RowP
142getPostsForUserLimitingQ lim = select (#postRowId `as` #fromOnly) $
142getPostsForUserLimitingQ lim = select (#postRowId `as` #fromOnly) $
143 (from $ table #posts) &
143 (from $ table #posts) &
144 where_ (#postRowAuthorId .== param @1) &
144 where_ (#postRowAuthorId .== param @1) &
145+ orderBy [#postRowId & Desc] &
145 limit lim
146 limit lim
146
147
147getPostsForUser :: Word64 -> UserId -> StaticPQ [Post]
148getPostsForUser :: Word64 -> UserId -> StaticPQ [Post]