Skip to content

Commit bd7aa00

Browse files
author
joeltaylor
committed
Reduce the amount of fiveJS stories
1 parent 31b907b commit bd7aa00

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

server/services/articles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var Articles = {
1616
// along with user infomation.
1717
recent(cb) {
1818
db.query(
19-
'SELECT a.news, a.url, a.title, a.slug, a.body, a.published_at, u.name, u.avatar_url, (SELECT COUNT(*) FROM comments WHERE article_id = a.id) AS comment_count FROM articles AS a LEFT JOIN users AS u ON a.user_id = u.id WHERE a.id IN (SELECT id FROM articles WHERE news = true AND approved = true ORDER BY published_at DESC LIMIT 25) OR a.id IN (SELECT id FROM articles WHERE news = false AND approved = true ORDER BY published_at DESC LIMIT 25) ORDER BY published_at DESC;',
19+
'SELECT a.news, a.url, a.title, a.slug, a.body, a.published_at, u.name, u.avatar_url, (SELECT COUNT(*) FROM comments WHERE article_id = a.id) AS comment_count FROM articles AS a LEFT JOIN users AS u ON a.user_id = u.id WHERE a.id IN (SELECT id FROM articles WHERE news = true AND approved = true ORDER BY published_at DESC LIMIT 10) OR a.id IN (SELECT id FROM articles WHERE news = false AND approved = true ORDER BY published_at DESC LIMIT 25) ORDER BY published_at DESC;',
2020
[],
2121
cb
2222
)

0 commit comments

Comments
 (0)