|
|
|
@ -40,6 +40,14 @@ function Repertoire() {
|
|
|
|
|
});
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
function handleDeleteClick(contact) {
|
|
|
|
|
api.delete('/Contact/Delete/' + contact.idcontact).then((response) => {
|
|
|
|
|
const newContacts = contacts.filter((c) => c.idcontact !== contact.idcontact);
|
|
|
|
|
setContacts(newContacts);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<body className={theme}>
|
|
|
|
|
<div className="page_repertoire">
|
|
|
|
@ -73,6 +81,7 @@ function Repertoire() {
|
|
|
|
|
<TableCell>Nom</TableCell>
|
|
|
|
|
<TableCell>Prénom</TableCell>
|
|
|
|
|
<TableCell>Entreprise</TableCell>
|
|
|
|
|
<TableCell>Supprimer</TableCell>
|
|
|
|
|
</TableRow>
|
|
|
|
|
</TableHead>
|
|
|
|
|
<TableBody>
|
|
|
|
@ -82,6 +91,7 @@ function Repertoire() {
|
|
|
|
|
<TableCell>{contact.lastname}</TableCell>
|
|
|
|
|
<TableCell>{contact.firstname}</TableCell>
|
|
|
|
|
<TableCell>{contact.name}</TableCell>
|
|
|
|
|
<TableCell><button className="boutonSuppContact" onClick={() => handleDeleteClick(contact)}>Supprimer</button></TableCell>
|
|
|
|
|
</TableRow>
|
|
|
|
|
))}
|
|
|
|
|
</TableBody>
|
|
|
|
@ -121,6 +131,23 @@ function Repertoire() {
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function SupprimerContact(props) {
|
|
|
|
|
|
|
|
|
|
const navigate = useNavigate();
|
|
|
|
|
const deleteContact = (id) => {
|
|
|
|
|
api.delete('/Contact/' + id).then(() => {
|
|
|
|
|
props.getContactList();
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="ui main">
|
|
|
|
|
<h2>Supprimer Contact</h2>
|
|
|
|
|
<button className="ui button blue" onClick={() => deleteContact(props.id)}>Supprimer</button>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function AddContact(props) {
|
|
|
|
|
|
|
|
|
|
const navigate = useNavigate();
|
|
|
|
|