Removed getPostsForRSS and getPosts now returns all posts.

This commit is contained in:
Alexander Andreev 2022-01-21 20:56:46 +04:00
parent 9b4c0e76bf
commit 48bdab2589
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -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,