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

322
Views
How to delete a data of both api in mongodb using nodejs and express?

So, I have been trying to delete a particular object's property with axios and used axios.delete(url).. I used this function inside a onClick operator. It was Like this ->

const deleteFromMyItems = async () => {
    const url = `http://localhost:5000/myItems/${_id}`;
    const ok = window.confirm('Are you sure?');
    if (ok) {
        await axios.delete(url, {
            headers: {
                authorization: `Bearer ${localStorage.getItem('accessToken')}`
            }
        })
        await axios.delete(`http://localhost:5000/laptops/${_id}`)
        
    }
}

but the problem is that It only deletes one of them...... I want to delete both together....

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!