tweaking and adding homepage with trending and so on
This commit is contained in:
+1
-1
@@ -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}")`)
|
||||
|
||||
Reference in New Issue
Block a user