79166907

Date: 2024-11-07 14:36:24
Score: 1.5
Natty:
Report link

I found the issue. Just thought I'd post this incase anyone has the same issue.

The users inputted their author name with a space after the last character in the name. This caused the issue. I just added a .trim() method to the end of my variable that parsed the author input in my route that added posts to the database. This has resolved the problem.

// Add entry to database
app.post("/submit", async (req, res) =>{
    let author = req.body.author.trim();

Thanks

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Dexedus