From 7e11e3a5e6dcf9cabf09c34263d4407e006ebd58 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sat, 27 Aug 2022 04:19:11 +0400 Subject: [PATCH] A default page size made 60. Deleted fields email and hide_email. --- homepage/guestbook.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/homepage/guestbook.js b/homepage/guestbook.js index 04d73a1..e679573 100644 --- a/homepage/guestbook.js +++ b/homepage/guestbook.js @@ -10,7 +10,7 @@ let connection = mysql.createConnection(config.database); connection.config.queryFormat = util.mysqlQueryFormat; exports.pageSize = config.guestbook.pageSize !== undefined - ? config.guestbook.pageSize : 20; + ? config.guestbook.pageSize : 60; exports.closeConnection = () => connection.end(); @@ -21,11 +21,6 @@ exports.getPosts = async (page = 1, page_size = exports.pageSize) => { guestbook.post_id, guestbook.created, guestbook.name, - (CASE - WHEN guestbook.hide_email IS false - THEN guestbook.email - ELSE NULL - END) AS email, (CASE WHEN guestbook.hide_website IS false THEN guestbook.website @@ -59,8 +54,8 @@ exports.getPostsCount = async () => { exports.addPost = async (post) => { return new Promise((resolve, reject) => { - let query = "INSERT INTO `guestbook` (`name`, `email`, `website`, `message`, `hide_website`, `hide_email`) \ - VALUES (:name, :email, :website, :message, :hide_website, :hide_email);"; + let query = "INSERT INTO `guestbook` (`name`, `website`, `message`, `hide_website`) \ + VALUES (:name, :website, :message, :hide_website);"; if (post.message === undefined || post.message === "") return reject("empty message");