From ff5ac2528a35c422842eee6d36588d30275d05fd Mon Sep 17 00:00:00 2001
From: "narindra.rajohnso" <narindra-hasimanjaka-david.rajohnson@etu.hesge.ch>
Date: Tue, 13 Jun 2023 15:24:16 +0200
Subject: [PATCH] correct api requests

---
 .../quizz-game/src/app/manage/manage.service.ts | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/Frontend/quizz-game/src/app/manage/manage.service.ts b/Frontend/quizz-game/src/app/manage/manage.service.ts
index 69f0bc4..8f74837 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;
-- 
GitLab