diff --git a/Frontend/quizz-game/src/app/manage/manage.service.ts b/Frontend/quizz-game/src/app/manage/manage.service.ts index 69f0bc4c240fd574d53c32be3721f8a5612b040f..8f748377cc5643ce204ba397962e5c40d713fe3d 100644 --- a/Frontend/quizz-game/src/app/manage/manage.service.ts +++ b/Frontend/quizz-game/src/app/manage/manage.service.ts @@ -11,10 +11,7 @@ interface UserData { firstname: string; lastname: string; email: string; - password: string; type: string; - createdAt: string; - updatedAt: string; } interface QuestionData { @@ -24,8 +21,6 @@ interface QuestionData { correctResponse: number; category: string; type: string; - createdAt: string; - updatedAt: string; } @Injectable({ @@ -86,7 +81,7 @@ export class ManageService { user.lastname, user.email, user.type, - user.password + "CONFIDENTIAL!!!" ) ) }) @@ -171,6 +166,7 @@ export class ManageService { take(1), tap((users) => { this.changeTypeKey(userInfo); + userInfo.password="CONFIDENTIAL!!!"; this._users.next(users.concat(userInfo)); }) ); @@ -293,11 +289,9 @@ export class ManageService { } deleteUser(username: string) { - const body = { username: username }; return this.httpClient .request('delete', - `http://localhost:30992/api/v1/admins/${this.username}/users/${username}`, - {body: body} + `http://localhost:30992/api/v1/admins/${this.username}/users/${username}` ) .pipe(switchMap(() => { return this.users; @@ -307,15 +301,12 @@ export class ManageService { this._users.next(users.filter((u) => u.username !== username)); }) ); - } deleteQuestion(id: number) { - const body = { id: id }; return this.httpClient .request('delete', - `http://localhost:30992/api/v1/admins/${this.username}/questions/${id}`, - {body: body} + `http://localhost:30992/api/v1/admins/${this.username}/questions/${id}` ) .pipe(switchMap(() => { return this.questions;