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

153
Views
¿Cómo acceder a la identificación de datos de la API para la operación de eliminación en reaccionar JS? data._id no funciona... es necesario aceptar el ID de la API para eliminar la API
const deleteHandler = async () => { await axios.delete('(http://localhost:5000/users/)' + editId).then((res) => { const deleteUser = data.filter((obj) => obj._id !== editId); handleGet(); setData(deleteUser); setEditId(''); }); };

necesita aceptar la identificación de la API para la eliminación de la API.

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

0

Perdiste los paréntesis:

 await axios.delete('(http://localhost:5000/users/)' + editId)

Debiera ser:

 await axios.delete('http://localhost:5000/users/' + editId)

También puedes usarlo con acentos graves:

 Should be: await axios.delete(`http://localhost:5000/users/${editId}`)

Es posible que desee pasar la identificación en el cuerpo de la solicitud:

 const res = await axios.delete('http://localhost:5000/users', { data: { id: editId } });
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!