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

103
Views
El estado no cambia cuando elimino datos de aquí
const [products, setProducts] = useMangeProduct([]); const handelDeleteProduct = id => { const url = `https://fierce-everglades-14403.herokuapp.com/product/${id}`; fetch(url, { method: 'DELETE', }).then(res => res.json()) .then(data => { console.log(data); if (data?.acknowledged === true) { const restProducts = products.filter(product => product._id !== id) setProducts(restProducts); toast.error('Product Delete successfully') } }) }

** cambio de estado ** datos eliminados pero el estado no cambia. si vuelvo a cargar la página para poder ver mis datos se eliminan. Pero cuando hago clic en el botón Eliminar, no hay cambios.

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

0

¿Quieres decir de esa manera?

 let sure = confirm('Do you want to delete your constumer?'); if (sure) { // code to send fetch to your server }
about 4 years ago · Juan Pablo Isaza Report

0

He usado algo como esto para Anchor Link. Espero que ayude.

 <a href="#" onclick="if (confirm('Do you really want to delete this User?')) {return true;}else{event.stopPropagation(); event.preventDefault();};"> Delete User </a>
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!