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

223
Vistas
How to delete item from JSON server list?

I'm trying to delete item from the list but, i think my endpoint is incorrect.

My enpoint is like: http://localhost:3001/notes/360e88a6-6dde-4971-b32c-802963013c29 and id is genereated by uuid.

JSON structure is like { content: "seoul", phone: "111-222-333", date: "11.4.2022", important: false, id: "4426ad6e-e22f-4a83-859c-a3436bf06959" }, { content: "daegu", phone: "555-666-777", date: "11.4.2022", important: true, id: "03c08131-4866-40a3-b44c-e161c163e467" }

Functionality

const baseUrl = 'http://localhost:3001/notes'
const delete_person = (id) => {
  return axios.delete(`${baseUrl}/${id}`)
}

  function handleDelete(id) {
    const newList = todos.filter((item) => item.id !== id);
    axios.delete().then(response => {
      setContacts(contacts.concat(response.data))
      setNumberInput('');
      });
      return setTodos(newList);
  }
  
  return (
    <div className="App">
      <header className="App-header">
        <ol>
        {notes.map((todo, index) => {
          return (
            <li key={index}>
                <span>Name: {todo.content}, </span>
                <span>Phone {todo.phone}, </span>
                <span>Date {todo.date}, </span>
                <button type="button" onClick={handleDelete}>
                Remove
                </button>
              </li>
          )      
        })}
    </ol>```

about 4 years ago · Santiago Trujillo
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