diff --git a/src/app/components/user-table/user-table.html b/src/app/components/user-table/user-table.html
index 2b630fb..50869cd 100644
--- a/src/app/components/user-table/user-table.html
+++ b/src/app/components/user-table/user-table.html
@@ -44,13 +44,15 @@
|
diff --git a/src/app/components/user-table/user-table.ts b/src/app/components/user-table/user-table.ts
index 6c2af93..c572182 100644
--- a/src/app/components/user-table/user-table.ts
+++ b/src/app/components/user-table/user-table.ts
@@ -50,7 +50,20 @@ export class UserTable implements OnInit {
this.usersLoading.set(false)
}
- delete() {
- return
+ async delete(user:number) {
+ try {
+ await firstValueFrom(this.usersService.deleteUserEndpoint(user))
+ this.notificationService.success(
+ 'Success',
+ 'Suppression effectuée'
+ )
+ } catch (e) {
+ this.notificationService.error(
+ 'Erreur',
+ 'Impossible de supprimer la ligne'
+ )
+ }
+
+ await this.fetchUsers();
}
}
diff --git a/src/app/pages/user/user.ts b/src/app/pages/user/user.ts
index cac50ce..c75bf1e 100644
--- a/src/app/pages/user/user.ts
+++ b/src/app/pages/user/user.ts
@@ -51,6 +51,11 @@ export class User {
users.birthDate = birthDate;
await firstValueFrom(this.usersService.createUserEndpoint(users))
+
+ this.notificationService.success(
+ 'Success',
+ 'Utilisateur crée'
+ )
} catch (e) {
this.notificationService.error(
'Erreur',