Browse Source

second commit

placidenduwayo 2 years ago
parent
commit
7b8468c404

+ 32
- 0
README-COPY.md View File

1
+# Partie fronted: application Angular
2
+
3
+This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.3.4.
4
+
5
+## Introduction
6
+Dans cette partie fronted, nous avons utilisé le pattern **NgRx** d'Angular et le framework Primeng.
7
+
8
+- Le pattern NgRx met en place des modules nécessaires pour la gestion de différents états de l'application dans le store.
9
+    - La documentation [pattern NgRx](https://ngrx.io/docs) présente en détail ces modules pour mettre en place le pattern NgRx.
10
+- Pour les différents styles graphiques, Angular possède son propre framework Primeng.
11
+    - Pour en savoir plus, la documentation [Primeng](https://www.primefaces.org/primeng/setup)
12
+
13
+
14
+## Les dépendances
15
+
16
+1. Pour la mise en place du pattern NgRx d'Angular, les modules installés:
17
+    - store
18
+    - store-devtools
19
+    - effects
20
+2. Pour la gestion des styles:
21
+    - Primeng. 
22
+
23
+3. Toutes ces dépendances et les autres dépendances nécessaires pour exécuter l'application sont recensées dans le fichier **package.json** à la racine du répertoire de l'application
24
+
25
+## Lancement de l'application frontend
26
+1. Récupérer le repository : `git clone` https://gitea.natan.fr/placidenduwayo/projects-management-microservices-frontend.git
27
+2. Néttoyer l'application et fixer toutes les vulnérabilités en exécutant la ligne de commande `npm audit fix`
28
+    - Cette ligne de commande va télécharger puis installer dans le package **node_modules** toutes les dépendances nécessaires pour l'application
29
+
30
+3. Exécuter l'application avec la ligne de commande :`npm start` ou `ng serve`
31
+4. Aller à la page d'accueil http:localhost:4200:
32
+    ![page de présentation de l'application](https://drive.google.com/file/d/1CfXun5Sov_q5f045fJGCv0lk2XUq7_DN/view?usp=sharing)

+ 10
- 10
src/app/ngrx/user/user.actions.ts View File

1
 import { UserActionTypes } from './user.action.type';
1
 import { UserActionTypes } from './user.action.type';
2
 import { Action } from '@ngrx/store';
2
 import { Action } from '@ngrx/store';
3
-import { User } from 'src/app/shared/models/user/user.model';
3
+import { AppUser } from 'src/app/shared/models/user/user.model';
4
 import { Project } from 'src/app/shared/models/project/project.model';
4
 import { Project } from 'src/app/shared/models/project/project.model';
5
 
5
 
6
 //get all user action
6
 //get all user action
10
 }
10
 }
11
 export class GetAllUsersActionSuccess implements Action {
11
 export class GetAllUsersActionSuccess implements Action {
12
   type: UserActionTypes = UserActionTypes.GET_ALL_USERS_SUCCESS;
12
   type: UserActionTypes = UserActionTypes.GET_ALL_USERS_SUCCESS;
13
-  constructor(public payload: Array<User>, public addressID: any) {}
13
+  constructor(public payload: Array<AppUser>, public addressID: any) {}
14
 }
14
 }
15
 export class GetAllUsersActionError implements Action {
15
 export class GetAllUsersActionError implements Action {
16
   type: UserActionTypes = UserActionTypes.GET_ALL_USERS_ERROR;
16
   type: UserActionTypes = UserActionTypes.GET_ALL_USERS_ERROR;
34
 // save new user action
34
 // save new user action
35
 export class SaveNewUserAction implements Action{
35
 export class SaveNewUserAction implements Action{
36
   type: UserActionTypes = UserActionTypes.SAVE_NEW_USER;
36
   type: UserActionTypes = UserActionTypes.SAVE_NEW_USER;
37
-  constructor(public payload:User){}
37
+  constructor(public payload:AppUser){}
38
 }
38
 }
39
 export class SaveNewUserActionSuccess implements Action{
39
 export class SaveNewUserActionSuccess implements Action{
40
   type: UserActionTypes = UserActionTypes.SAVE_NEW_USER_SUCCESS;
40
   type: UserActionTypes = UserActionTypes.SAVE_NEW_USER_SUCCESS;
41
-  constructor(public payload:User){}
41
+  constructor(public payload:AppUser){}
42
 }
42
 }
43
 export class SaveNewUserActionError implements Action{
43
 export class SaveNewUserActionError implements Action{
44
   type: UserActionTypes = UserActionTypes.SAVE_NEW_USER_ERROR;
44
   type: UserActionTypes = UserActionTypes.SAVE_NEW_USER_ERROR;
48
 // delete user action
48
 // delete user action
49
 export class DeleteUserAction implements Action{
49
 export class DeleteUserAction implements Action{
50
   type: UserActionTypes = UserActionTypes.DELETE_USER;
50
   type: UserActionTypes = UserActionTypes.DELETE_USER;
51
-  constructor(public payload: User,  public addressID: any){}
51
+  constructor(public payload: AppUser,  public addressID: any){}
52
 }
52
 }
53
 export class DeleteUserActionSuccess implements Action{
53
 export class DeleteUserActionSuccess implements Action{
54
   type: UserActionTypes = UserActionTypes.DELETE_USER_SUCCCESS;
54
   type: UserActionTypes = UserActionTypes.DELETE_USER_SUCCCESS;
55
-  constructor(public payload: User,  public addressID: any){}
55
+  constructor(public payload: AppUser,  public addressID: any){}
56
 }
56
 }
57
 export class DeleteUserActionError implements Action{
57
 export class DeleteUserActionError implements Action{
58
   type: UserActionTypes = UserActionTypes.DELETE_USER_ERROR;
58
   type: UserActionTypes = UserActionTypes.DELETE_USER_ERROR;
62
 // form to update user action
62
 // form to update user action
63
 export class CreateFormUpdateUserAction implements Action{
63
 export class CreateFormUpdateUserAction implements Action{
64
   type: UserActionTypes = UserActionTypes.CREATE_FORM_UPDATE_USER;
64
   type: UserActionTypes = UserActionTypes.CREATE_FORM_UPDATE_USER;
65
-  constructor(public payload: User,  public addressID: any){}
65
+  constructor(public payload: AppUser,  public addressID: any){}
66
 }
66
 }
67
 export class CreateFormUpdateUserActionSuccess implements Action{
67
 export class CreateFormUpdateUserActionSuccess implements Action{
68
   type: UserActionTypes = UserActionTypes.CREATE_FORM_UPDATE_USER_SUCCESS;
68
   type: UserActionTypes = UserActionTypes.CREATE_FORM_UPDATE_USER_SUCCESS;
69
-  constructor(public payload: User,  public addressID: any){}
69
+  constructor(public payload: AppUser,  public addressID: any){}
70
 }
70
 }
71
 export class CreateFormUpdateUserActionError implements Action{
71
 export class CreateFormUpdateUserActionError implements Action{
72
   type: UserActionTypes = UserActionTypes.CREATE_FORM_UPDATE_USER_ERROR;
72
   type: UserActionTypes = UserActionTypes.CREATE_FORM_UPDATE_USER_ERROR;
76
 //update user
76
 //update user
77
 export class UpdateUserAction implements Action{
77
 export class UpdateUserAction implements Action{
78
   type: UserActionTypes = UserActionTypes.UPDATE_USER;
78
   type: UserActionTypes = UserActionTypes.UPDATE_USER;
79
-  constructor(public payload: User){}
79
+  constructor(public payload: AppUser){}
80
 }
80
 }
81
 export class UpdateUserActionSuccess implements Action{
81
 export class UpdateUserActionSuccess implements Action{
82
   type: UserActionTypes = UserActionTypes.UPDATE_USER_SUCCESS;
82
   type: UserActionTypes = UserActionTypes.UPDATE_USER_SUCCESS;
83
-  constructor(public payload: User){}
83
+  constructor(public payload: AppUser){}
84
 }
84
 }
85
 export class UpdateUserActionError implements Action{
85
 export class UpdateUserActionError implements Action{
86
   type: UserActionTypes = UserActionTypes.UPDATE_USER_ERROR;
86
   type: UserActionTypes = UserActionTypes.UPDATE_USER_ERROR;

+ 2
- 2
src/app/ngrx/user/user.effects.create.ts View File

11
 import { map, Observable, of, mergeMap } from 'rxjs';
11
 import { map, Observable, of, mergeMap } from 'rxjs';
12
 import { Actions, createEffect, ofType } from '@ngrx/effects';
12
 import { Actions, createEffect, ofType } from '@ngrx/effects';
13
 import { Injectable } from '@angular/core';
13
 import { Injectable } from '@angular/core';
14
-import { User } from 'src/app/shared/models/user/user.model';
14
+import { AppUser } from 'src/app/shared/models/user/user.model';
15
 
15
 
16
 @Injectable()
16
 @Injectable()
17
 export class UserCreateEffects {
17
 export class UserCreateEffects {
35
           .createUserService(action.payload)
35
           .createUserService(action.payload)
36
           .pipe(
36
           .pipe(
37
             map(
37
             map(
38
-              (user: User) =>
38
+              (user: AppUser) =>
39
                 new SaveNewUserActionSuccess(user)
39
                 new SaveNewUserActionSuccess(user)
40
             ),
40
             ),
41
             catchError((err) => of(new SaveNewUserActionError(err.message)))
41
             catchError((err) => of(new SaveNewUserActionError(err.message)))

+ 2
- 2
src/app/ngrx/user/user.effects.get.ts View File

9
 import { UserService } from '../../shared/services/user.service';
9
 import { UserService } from '../../shared/services/user.service';
10
 import { Injectable } from '@angular/core';
10
 import { Injectable } from '@angular/core';
11
 import { Actions, createEffect, ofType } from '@ngrx/effects';
11
 import { Actions, createEffect, ofType } from '@ngrx/effects';
12
-import { User } from 'src/app/shared/models/user/user.model';
12
+import { AppUser } from 'src/app/shared/models/user/user.model';
13
 
13
 
14
 @Injectable()
14
 @Injectable()
15
 export class UserGetAllEffects {
15
 export class UserGetAllEffects {
20
       ofType(UserActionTypes.GET_ALL_USERS),
20
       ofType(UserActionTypes.GET_ALL_USERS),
21
       mergeMap((action: UserActionUnion) => {
21
       mergeMap((action: UserActionUnion) => {
22
         return this.userservice.geAllUsersService().pipe(
22
         return this.userservice.geAllUsersService().pipe(
23
-          map((users: User[]) => new GetAllUsersActionSuccess(users, {})),
23
+          map((users: AppUser[]) => new GetAllUsersActionSuccess(users, {})),
24
           catchError((err) => of(new GetAllUsersActionError(err, {})))
24
           catchError((err) => of(new GetAllUsersActionError(err, {})))
25
         );
25
         );
26
       })
26
       })

+ 3
- 3
src/app/ngrx/user/user.effects.update.ts View File

11
 import { Actions, createEffect, ofType } from '@ngrx/effects';
11
 import { Actions, createEffect, ofType } from '@ngrx/effects';
12
 import { UserService } from './../../shared/services/user.service';
12
 import { UserService } from './../../shared/services/user.service';
13
 import { Injectable } from '@angular/core';
13
 import { Injectable } from '@angular/core';
14
-import { User } from 'src/app/shared/models/user/user.model';
14
+import { AppUser } from 'src/app/shared/models/user/user.model';
15
 
15
 
16
 @Injectable()
16
 @Injectable()
17
 export class UserUpdateEffects {
17
 export class UserUpdateEffects {
23
       ofType(UserActionTypes.CREATE_FORM_UPDATE_USER),
23
       ofType(UserActionTypes.CREATE_FORM_UPDATE_USER),
24
       mergeMap((action: UserActionUnion) => {
24
       mergeMap((action: UserActionUnion) => {
25
         return this.userService.getUserByID(action.payload.userID).pipe(
25
         return this.userService.getUserByID(action.payload.userID).pipe(
26
-          map((user: User) => new CreateFormUpdateUserActionSuccess(user,{})),
26
+          map((user: AppUser) => new CreateFormUpdateUserActionSuccess(user,{})),
27
           catchError((err) => of(new CreateFormUpdateUserActionError(err,{})))
27
           catchError((err) => of(new CreateFormUpdateUserActionError(err,{})))
28
         );
28
         );
29
       })
29
       })
36
       ofType(UserActionTypes.UPDATE_USER),
36
       ofType(UserActionTypes.UPDATE_USER),
37
       mergeMap((action: UserActionUnion) =>{
37
       mergeMap((action: UserActionUnion) =>{
38
         return this.userService.updateUserService(action.payload).pipe(
38
         return this.userService.updateUserService(action.payload).pipe(
39
-          map ((user: User) => new UpdateUserActionSuccess(user)),
39
+          map ((user: AppUser) => new UpdateUserActionSuccess(user)),
40
           catchError( err => of(new UpdateUserActionError(err)))
40
           catchError( err => of(new UpdateUserActionError(err)))
41
         )
41
         )
42
       })
42
       })

+ 7
- 7
src/app/ngrx/user/user.reducer.ts View File

3
 import { Action } from '@ngrx/store';
3
 import { Action } from '@ngrx/store';
4
 import { MsgState } from '../msg.state';
4
 import { MsgState } from '../msg.state';
5
 import { UserState } from './user.state';
5
 import { UserState } from './user.state';
6
-import { User } from 'src/app/shared/models/user/user.model';
6
+import { AppUser } from 'src/app/shared/models/user/user.model';
7
 
7
 
8
 const userInitiallState: UserState = {
8
 const userInitiallState: UserState = {
9
   currentUser: undefined,
9
   currentUser: undefined,
61
         msgState:MsgState.ADD
61
         msgState:MsgState.ADD
62
       }
62
       }
63
     case UserActionTypes.SAVE_NEW_USER_SUCCESS:
63
     case UserActionTypes.SAVE_NEW_USER_SUCCESS:
64
-      let newUser: User = (<UserActionUnion> action).payload;
65
-      let usersListCopy1: Array<User> = [...state.usersList];
64
+      let newUser: AppUser = (<UserActionUnion> action).payload;
65
+      let usersListCopy1: Array<AppUser> = [...state.usersList];
66
       usersListCopy1.push(newUser);
66
       usersListCopy1.push(newUser);
67
       return{
67
       return{
68
         ...state,
68
         ...state,
83
         msgState: MsgState.DELETE
83
         msgState: MsgState.DELETE
84
       };
84
       };
85
     case UserActionTypes.DELETE_USER_SUCCCESS:
85
     case UserActionTypes.DELETE_USER_SUCCCESS:
86
-      let deletedUser : User = (<UserActionUnion> action).payload;
86
+      let deletedUser : AppUser = (<UserActionUnion> action).payload;
87
       let deletedUserIndex = state.usersList.indexOf(deletedUser);
87
       let deletedUserIndex = state.usersList.indexOf(deletedUser);
88
-      let usersListCopy2: Array<User> = [...state.usersList];
88
+      let usersListCopy2: Array<AppUser> = [...state.usersList];
89
       usersListCopy2.splice(deletedUserIndex,1);
89
       usersListCopy2.splice(deletedUserIndex,1);
90
       return{
90
       return{
91
         ...state,
91
         ...state,
128
         msgState: MsgState.UPDATE
128
         msgState: MsgState.UPDATE
129
       };
129
       };
130
     case UserActionTypes.UPDATE_USER_SUCCESS:
130
     case UserActionTypes.UPDATE_USER_SUCCESS:
131
-      let updatedUser: User = (<UserActionUnion> action).payload;
132
-      let usersListCopy3: Array<User> = [...state.usersList];
131
+      let updatedUser: AppUser = (<UserActionUnion> action).payload;
132
+      let usersListCopy3: Array<AppUser> = [...state.usersList];
133
       usersListCopy3.map(
133
       usersListCopy3.map(
134
         (user) => (user.userID==updatedUser.userID)?updatedUser:user
134
         (user) => (user.userID==updatedUser.userID)?updatedUser:user
135
         );
135
         );

+ 3
- 3
src/app/ngrx/user/user.state.ts View File

1
 import { MsgState } from '../msg.state';
1
 import { MsgState } from '../msg.state';
2
-import { User } from './../../shared/models/user/user.model';
2
+import { AppUser } from './../../shared/models/user/user.model';
3
 export class UserState{
3
 export class UserState{
4
-  currentUser!: User | undefined;
5
-  usersList!: User[];
4
+  currentUser!: AppUser | undefined;
5
+  usersList!: AppUser[];
6
   msgState!: MsgState;
6
   msgState!: MsgState;
7
   errorMsg!: string;
7
   errorMsg!: string;
8
 }
8
 }

+ 2
- 2
src/app/pages/user-manager/user-management/user-create/user-create.component.ts View File

1
 import { UserType } from './../../../../shared/models/user/user.type';
1
 import { UserType } from './../../../../shared/models/user/user.type';
2
 import { Router } from '@angular/router';
2
 import { Router } from '@angular/router';
3
-import { User } from 'src/app/shared/models/user/user.model';
3
+import { AppUser } from 'src/app/shared/models/user/user.model';
4
 import { MsgState } from './../../../../ngrx/msg.state';
4
 import { MsgState } from './../../../../ngrx/msg.state';
5
 import {
5
 import {
6
   CreateFormAddUserAction,
6
   CreateFormAddUserAction,
81
 
81
 
82
   onUserSave() {
82
   onUserSave() {
83
     let model: any = this.userFormGroup.value;
83
     let model: any = this.userFormGroup.value;
84
-    let user: User = new User();
84
+    let user: AppUser = new AppUser();
85
     user.firstname = model.firstname;
85
     user.firstname = model.firstname;
86
     user.lastname = model.lastname;
86
     user.lastname = model.lastname;
87
     user.userType = model.userType;
87
     user.userType = model.userType;

+ 2
- 2
src/app/pages/user-manager/user-management/user-navbar/user-navbar.component.ts View File

1
-import { User } from 'src/app/shared/models/user/user.model';
1
+import { AppUser } from 'src/app/shared/models/user/user.model';
2
 import { Component, Input, OnInit } from '@angular/core';
2
 import { Component, Input, OnInit } from '@angular/core';
3
 import { Store } from '@ngrx/store';
3
 import { Store } from '@ngrx/store';
4
 import { GetAllUsersAction } from 'src/app/ngrx/user/user.actions';
4
 import { GetAllUsersAction } from 'src/app/ngrx/user/user.actions';
15
 
15
 
16
   constructor(private store: Store<{userReducer: UserState}>, private router: Router) { }
16
   constructor(private store: Store<{userReducer: UserState}>, private router: Router) { }
17
 
17
 
18
-  inputUsersList!: Array<User>
18
+  inputUsersList!: Array<AppUser>
19
   ngOnInit(): void {
19
   ngOnInit(): void {
20
 
20
 
21
   }
21
   }

+ 2
- 2
src/app/pages/user-manager/user-management/user-update/user-update.component.ts View File

1
 import { UserType } from './../../../../shared/models/user/user.type';
1
 import { UserType } from './../../../../shared/models/user/user.type';
2
-import { User } from 'src/app/shared/models/user/user.model';
2
+import { AppUser } from 'src/app/shared/models/user/user.model';
3
 import { GetAllAddressesAction } from 'src/app/ngrx/user-s-address/address.action';
3
 import { GetAllAddressesAction } from 'src/app/ngrx/user-s-address/address.action';
4
 import { AddressState } from './../../../../ngrx/user-s-address/address.state';
4
 import { AddressState } from './../../../../ngrx/user-s-address/address.state';
5
 import { CreateFormUpdateUserAction, UpdateUserAction } from './../../../../ngrx/user/user.actions';
5
 import { CreateFormUpdateUserAction, UpdateUserAction } from './../../../../ngrx/user/user.actions';
91
 
91
 
92
   onUserUpdate(){
92
   onUserUpdate(){
93
     let formModel = this.userFormGroup.value;
93
     let formModel = this.userFormGroup.value;
94
-    let user: User = new User();
94
+    let user: AppUser = new AppUser();
95
     user.userID = formModel.userID;
95
     user.userID = formModel.userID;
96
     user.firstname= formModel.firstname;
96
     user.firstname= formModel.firstname;
97
     user.lastname = formModel.lastname;
97
     user.lastname = formModel.lastname;

+ 5
- 5
src/app/pages/user-manager/user-management/users-list/users-list.component.ts View File

4
 import { UserState } from './../../../../ngrx/user/user.state';
4
 import { UserState } from './../../../../ngrx/user/user.state';
5
 import { Store } from '@ngrx/store';
5
 import { Store } from '@ngrx/store';
6
 import { Component, Input } from '@angular/core';
6
 import { Component, Input } from '@angular/core';
7
-import { User } from 'src/app/shared/models/user/user.model';
7
+import { AppUser } from 'src/app/shared/models/user/user.model';
8
 
8
 
9
 @Component({
9
 @Component({
10
   selector: 'app-users-list',
10
   selector: 'app-users-list',
16
     private store: Store<{ userReducerSelector: UserState }>,
16
     private store: Store<{ userReducerSelector: UserState }>,
17
     private router: Router
17
     private router: Router
18
   ) {}
18
   ) {}
19
-  @Input() inputUsersList!: User[];
19
+  @Input() inputUsersList!: AppUser[];
20
 
20
 
21
-  onUserEdit(user: User) {
21
+  onUserEdit(user: AppUser) {
22
     this.router.navigateByUrl("/user-update/"+user.userID);
22
     this.router.navigateByUrl("/user-update/"+user.userID);
23
   }
23
   }
24
 
24
 
25
-  onUserDelete(user: User) {
25
+  onUserDelete(user: AppUser) {
26
     if (window.confirm(MsgState.CONFIRM_DEL + ':' + user.email)) {
26
     if (window.confirm(MsgState.CONFIRM_DEL + ':' + user.email)) {
27
       this.store.dispatch(new DeleteUserAction(user, {}));
27
       this.store.dispatch(new DeleteUserAction(user, {}));
28
     }
28
     }
35
       this.store.dispatch(new GetAllUsersAction({},{})); //refresh
35
       this.store.dispatch(new GetAllUsersAction({},{})); //refresh
36
     }
36
     }
37
     else{
37
     else{
38
-      this.inputUsersList = this.inputUsersList.filter((user: User) => {
38
+      this.inputUsersList = this.inputUsersList.filter((user: AppUser) => {
39
         return user.firstname
39
         return user.firstname
40
           .toLocaleLowerCase()
40
           .toLocaleLowerCase()
41
           .match(this.firstname.toLocaleLowerCase());
41
           .match(this.firstname.toLocaleLowerCase());

+ 2
- 2
src/app/shared/models/project/project.model.ts View File

1
 import { Priority } from './project.priority';
1
 import { Priority } from './project.priority';
2
 
2
 
3
 import { Company } from './../company/company.model';
3
 import { Company } from './../company/company.model';
4
-import { User } from '../user/user.model';
4
+import { AppUser } from '../user/user.model';
5
 import { ProjState } from './project.state';
5
 import { ProjState } from './project.state';
6
 
6
 
7
 export class Project{
7
 export class Project{
13
   company!: Company;
13
   company!: Company;
14
   description!: string;
14
   description!: string;
15
   userID!: number;
15
   userID!: number;
16
-  user!: User;
16
+  user!: AppUser;
17
   projState!: ProjState;
17
   projState!: ProjState;
18
 }
18
 }

+ 1
- 1
src/app/shared/models/user/user.model.ts View File

1
 import { UserType } from './user.type';
1
 import { UserType } from './user.type';
2
 import { Address } from "./address.model";
2
 import { Address } from "./address.model";
3
 
3
 
4
-export class User{
4
+export class AppUser{
5
   userID!:number;
5
   userID!:number;
6
   firstname!: string;
6
   firstname!: string;
7
   lastname!: string;
7
   lastname!: string;

+ 8
- 8
src/app/shared/services/user.service.ts View File

2
 import { catchError } from 'rxjs/operators';
2
 import { catchError } from 'rxjs/operators';
3
 import { Injectable } from '@angular/core';
3
 import { Injectable } from '@angular/core';
4
 import { environment } from 'src/environments/environment';
4
 import { environment } from 'src/environments/environment';
5
-import { User } from '../models/user/user.model';
5
+import { AppUser } from '../models/user/user.model';
6
 import { Observable } from 'rxjs';
6
 import { Observable } from 'rxjs';
7
 import { HttpClient } from '@angular/common/http';
7
 import { HttpClient } from '@angular/common/http';
8
 
8
 
16
   ) {}
16
   ) {}
17
 
17
 
18
 
18
 
19
-  geAllUsersService(): Observable<Array<User>> {
20
-    let users: Observable<Array<User>> = this.httpClient.get<User[]>(
19
+  geAllUsersService(): Observable<Array<AppUser>> {
20
+    let users: Observable<Array<AppUser>> = this.httpClient.get<AppUser[]>(
21
       environment.USERS_SERVER + '/users'
21
       environment.USERS_SERVER + '/users'
22
     );
22
     );
23
     return users;
23
     return users;
24
   }
24
   }
25
 
25
 
26
-  createUserService(user: User): Observable<any> {
26
+  createUserService(user: AppUser): Observable<any> {
27
     return this.httpClient
27
     return this.httpClient
28
       .post<any>(environment.USERS_SERVER + '/users/', user)
28
       .post<any>(environment.USERS_SERVER + '/users/', user)
29
       .pipe(catchError(this.serverErrorHandler.handleError));
29
       .pipe(catchError(this.serverErrorHandler.handleError));
35
       .pipe(catchError(this.serverErrorHandler.handleError));
35
       .pipe(catchError(this.serverErrorHandler.handleError));
36
   }
36
   }
37
 
37
 
38
-  getUserByID(userID: number): Observable<User> {
38
+  getUserByID(userID: number): Observable<AppUser> {
39
     return this.httpClient
39
     return this.httpClient
40
-      .get<User>(environment.USERS_SERVER + '/users/' + userID)
40
+      .get<AppUser>(environment.USERS_SERVER + '/users/' + userID)
41
       .pipe(catchError(this.serverErrorHandler.handleError));
41
       .pipe(catchError(this.serverErrorHandler.handleError));
42
   }
42
   }
43
 
43
 
44
-  updateUserService(user: User): Observable<User> {
45
-    let updatedUser: Observable<User> = this.httpClient.put<User>(
44
+  updateUserService(user: AppUser): Observable<AppUser> {
45
+    let updatedUser: Observable<AppUser> = this.httpClient.put<AppUser>(
46
       environment.USERS_SERVER + '/users/' + user.userID,
46
       environment.USERS_SERVER + '/users/' + user.userID,
47
       user
47
       user
48
     );
48
     );

Powered by TurnKey Linux.