tweaking and adding homepage with trending and so on

This commit is contained in:
2024-01-25 16:25:03 +01:00
parent 421ab338fc
commit 3ad55cd36a
8 changed files with 351 additions and 2 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ router.post('/', async (req, res) => {
const formattedDate = currentDate.toLocaleDateString('en-gb');
const date = formattedDateAndTime + " " + formattedDate;
const newPost = await db.create('posts', {category: category, title: title, content: content, author: username, date: date});
const newPost = await db.create('posts', {category: category, title: title, content: content, author: username, date: date, likes: [], comments: [], saves: [], viewcount: 0});
postId = (newPost[0].id).slice(6);
const update = await db.query(`UPDATE users SET posts += "${postId}" WHERE username = string::lowercase("${username}")`)