diff --git a/support-portal-frontend/src/app/component/user/user.component.html b/support-portal-frontend/src/app/component/user/user.component.html
index a5ae6bc..36cc3d1 100644
--- a/support-portal-frontend/src/app/component/user/user.component.html
+++ b/support-portal-frontend/src/app/component/user/user.component.html
@@ -84,7 +84,7 @@
-
+
|
diff --git a/support-portal-frontend/src/app/component/user/user.component.ts b/support-portal-frontend/src/app/component/user/user.component.ts
index 1a662d4..9428437 100644
--- a/support-portal-frontend/src/app/component/user/user.component.ts
+++ b/support-portal-frontend/src/app/component/user/user.component.ts
@@ -6,6 +6,7 @@ import {NotificationService} from "../../service/notification.service";
import {NotificationType} from "../../notification/notification-type";
import {HttpErrorResponse} from "@angular/common/http";
import {NgForm} from "@angular/forms";
+import {CustomHttpResponse} from "../../dto/custom-http-response";
@Component({
selector: 'app-user',
@@ -153,4 +154,19 @@ export class UserComponent implements OnInit, OnDestroy {
);
this.subscriptions.push(subscription);
}
+
+ onDeleteUser(user: User) {
+ const subscription = this.userService.deleteUser(user.userId)
+ .subscribe(
+ (response: CustomHttpResponse) => {
+ this.getUsers(false);
+ this.invalidateVariables();
+ this.notificationService.notify(NotificationType.SUCCESS, response.message);
+ },
+ (errorResponse: HttpErrorResponse) => {
+ this.sendErrorNotification(errorResponse.error.message);
+ }
+ );
+ this.subscriptions.push(subscription);
+ }
}
diff --git a/support-portal-frontend/src/app/service/user.service.ts b/support-portal-frontend/src/app/service/user.service.ts
index d9e4c4c..a67b0a5 100644
--- a/support-portal-frontend/src/app/service/user.service.ts
+++ b/support-portal-frontend/src/app/service/user.service.ts
@@ -46,9 +46,9 @@ export class UserService {
});
}
- public deleteUser(userId: string): Observable {
+ public deleteUser(userId: string): Observable {
return this.httpClient
- .delete(`${this.host}/user/${userId}`);
+ .delete(`${this.host}/user/${userId}`);
}
public addUsersToLocalStorage(users: User[]) {