Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

79
Vistas
all TODO items being deleted when only one should. only one fetch call with correct ID

I am having a really weird issue with my To Do list app. When you delete one TODO from the list it is deleting all of them. this is the code

const deleteTask = (id) => { fetch(http://localhost:8088/tasks/${id}, { method: "DELETE", headers: { "Content-Type": "application/json" } }) .then(fetchTasks) }

onClick={() => {deleteTask(task.id)}}

All other features of a task item work appropriately but when I press this onClick and run the fetch call it deletes all tasks by the current user. In my network tab the fetch only shows to be running once using the proper ID.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

are you updating the UI with the fetchTasks after you removing the specific task or when do you do that ?

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda