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

222
Views
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
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!