Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

94
Views
express req.body returns value then returns undefined

so basically, i'm using this code:

app.post("/settings/update/:id/:category", async (req, res) => {
    let category = req.params.category;

    if (category == "goodbye") {
        var goodbye_message = req.body.goodbyeMessage;

        await vibes.db.setServerVar(
            "main",
            "leave_message",
            req.params.id,
            goodbye_message
        );

        var goodbye_channel = req.body.goodbyeChannel;

        console.log(goodbye_message, goodbye_channel)

        await vibes.db.setServerVar(
            "main",
            "leave_channel",
            req.params.id,
            goodbye_channel
        );
    }

    res.status(204).send();
});

and, when i submit my form, it returns the actual value that i use on my ejs files, but then it also returns undefined when i want to log it, like when i submit, it logs this in console:

undefined undefined

then it logs

test! 914519440576638997

so it basically logs as undefined, but then logs my value, how do i get rid of the undefined? because it makes my code not work proprely!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!