Update sorting of orders in list

This commit is contained in:
Rene Vergara 2022-07-26 10:46:35 -05:00
parent e9085d6b9e
commit da19d4a578
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -205,7 +205,7 @@ findOrderById :: String -> Action IO (Maybe Document)
findOrderById i = findOne (select ["_id" =: (read i :: B.ObjectId)] "orders")
findAllOrders :: T.Text -> Action IO [Document]
findAllOrders a = rest =<< find (select ["address" =: a] "orders")
findAllOrders a = rest =<< find (select ["address" =: a] "orders") {sort = ["timestamp" =: (negate 1 :: Int)]}
deleteOrder :: String -> Action IO ()
deleteOrder i = deleteOne (select ["_id" =: (read i :: B.ObjectId)] "orders")