Removed getPostsForRSS and getPosts now returns all posts.
This commit is contained in:
parent
9b4c0e76bf
commit
48bdab2589
@ -11,29 +11,11 @@ connection.config.queryFormat = util.mysqlQueryFormat;
|
||||
|
||||
exports.closeConnection = () => connection.end();
|
||||
|
||||
exports.getPosts = category => {
|
||||
exports.getPosts = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
let query = `
|
||||
SELECT
|
||||
blog.entry_id AS post_id,
|
||||
blog.date,
|
||||
blog.title,
|
||||
blog.body
|
||||
FROM blog
|
||||
LEFT JOIN blog_categories ON blog_categories.category_id = blog.category
|
||||
WHERE blog_categories.category = :category
|
||||
ORDER BY blog.date DESC;`;
|
||||
|
||||
connection.query(query, { category: category }, (err, results) => {
|
||||
if (err) reject(err);
|
||||
resolve(results); });
|
||||
});
|
||||
};
|
||||
|
||||
exports.getPostsForRSS = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
let query = `
|
||||
SELECT
|
||||
blog.date,
|
||||
blog_categories.category,
|
||||
blog.title,
|
||||
|
Loading…
Reference in New Issue
Block a user