Update the queries to get articles in the order new first.

main
KKlochko 1 year ago
parent 9d7ec9888b
commit c24fce08f3

@ -26,7 +26,7 @@
[client channel]
(go
(try
(let [res (<p! (. client query "select id, title, content, created from articles"))]
(let [res (<p! (. client query "select id, title, content, created from articles order by created desc"))]
(>! channel (.-rows res)))
(catch js/Error err (js/console.log (ex-cause err)))))
channel)
@ -40,7 +40,8 @@
(str "select id, title, "
"substr(content, 0, 60) content, "
"length(content) content_length, "
"created from articles")))]
"created from articles "
"order by created desc")))]
(>! channel (.-rows res)))
(catch js/Error err (js/console.log (ex-cause err)))))
channel)

Loading…
Cancel
Save