Skip to content

Commit

Permalink
Refactor phonebook database and update contact details
Browse files Browse the repository at this point in the history
  • Loading branch information
rashmikanaveen committed Sep 12, 2024
1 parent 0e9e649 commit b0aa914
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions part2/phonebook/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"id": "4"
},
{
"id": "a88e",
"name": "s",
"number": "s"
"id": "ddc4",
"name": "rashmika",
"number": "8448"
}
]
}
7 changes: 6 additions & 1 deletion part2/phonebook/src/components/PersonsAndNames.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import React from 'react';
import '../App.css';
import axios from 'axios'
import { useState,useEffect } from 'react'
//import personService from './services/persons'
import personService from '../services/persons'





const PersonsAndNames = (props) => {
const persons = props.persons;
//const [persons, setPersons] = useState([])



const ShowPerson = ({ person }) => {
return (
Expand All @@ -19,7 +24,7 @@ const PersonsAndNames = (props) => {
};

const DeleteNameAndNumber = (id) => {
console.log(name + ' wants to be deleted');
//console.log(name + ' wants to be deleted');
const url = `http://localhost:3001/persons/${id}`

const changPersons=persons.filter(person => person.id !== id)
Expand Down

0 comments on commit b0aa914

Please sign in to comment.