Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

78
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda