diff --git a/routes/rss.js b/routes/rss.js index 520130e..cd0a514 100644 --- a/routes/rss.js +++ b/routes/rss.js @@ -26,7 +26,7 @@ const generateRSSfeed = function() return new Promise((resolve, reject)=> { - sql.getRecentPosts(limit=200).then((data)=> + sql.getRecentPosts(200).then((data)=> { for(var i = 0; i < data.length; i++) { diff --git a/utils/sql.js b/utils/sql.js index 5af915e..05d17be 100644 --- a/utils/sql.js +++ b/utils/sql.js @@ -279,12 +279,13 @@ module.exports= * * @return {*|Promise} */ - getRecentPosts: function() + getRecentPosts: function(limit) { + limit = (limit == null) ? 10 : limit; return new Promise(function(resolve, reject) { var q = "select name,url, published, category_id from posts order " + - "by post_id desc limit 10"; + "by post_id desc limit " + limit; fetch(q).then(function(sqlPosts) { fetchWithCategoryInformation(sqlPosts).then(function(data)