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

202
Views
Trying to delete using Node.js Mongoose
app.delete("/tm/v1/tasks", (req,res) => {
      Task.findOneAndDelete(req.body.id, (err, car) => {
        if (err){
          res.status(500).json({msg: error});
        }
      res.status(200).json({tasks});
      })
});

The above isn't working and is giving an error 404. any ideas?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

  • please check if you have are using correct url
  • we can add body to delete request in postman or curl but its not possible to pass body in javascript, dart (http package), etc.
  • you can rewrite function as
app.post('/tm/v1/delete-tasks', (req, res) => {
    // write your code here...
});
about 4 years ago · Juan Pablo Isaza Report
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!