This commit is contained in:
Daniella / Tove 2023-03-27 22:05:58 +02:00 committed by GitHub
parent 4cfabd7663
commit 5ee052bd93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,7 +79,8 @@ server.all('/comment', function get(req, res) {
function recurse(post) { function recurse(post) {
console.log(String(cid) + ' ' + comment) console.log(String(cid) + ' ' + comment)
if(String(cid) === comment) { if(String(cid) === comment) {
if(req.body.name && req.body.title && req.body.content) { if(req.body.name && req.body.content) {
if(!req.body.title) req.body.title = '';
let p = {timestamp: new Date().getTime(), author: req.body.name, title: req.body.title, content: req.body.content.replaceAll('\r\n', '\n'), comments: []} let p = {timestamp: new Date().getTime(), author: req.body.name, title: req.body.title, content: req.body.content.replaceAll('\r\n', '\n'), comments: []}
post.comments.push(p) post.comments.push(p)
if(fake) { if(fake) {