Update the queries to get articles in the order new first.
This commit is contained in:
@@ -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)
|
||||
@@ -37,10 +37,11 @@
|
||||
(go
|
||||
(try
|
||||
(let [res (<p! (. client query
|
||||
(str "select id, title,"
|
||||
"substr(content, 0, 60) content,"
|
||||
"length(content) content_length,"
|
||||
"created from articles")))]
|
||||
(str "select id, title, "
|
||||
"substr(content, 0, 60) content, "
|
||||
"length(content) content_length, "
|
||||
"created from articles "
|
||||
"order by created desc")))]
|
||||
(>! channel (.-rows res)))
|
||||
(catch js/Error err (js/console.log (ex-cause err)))))
|
||||
channel)
|
||||
|
||||
Reference in New Issue
Block a user