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

Loading…
Cancel
Save