From c28a787f002e5d37f58de8d5c4ec393c6c35a14d Mon Sep 17 00:00:00 2001 From: Art Date: Sun, 12 Sep 2021 11:55:10 +0300 Subject: [PATCH] 99. Creating user class (#12) --- .../src/app/model/user.spec.ts | 7 +++++++ support-portal-frontend/src/app/model/user.ts | 15 +++++++++++++++ .../src/app/service/authentication.service.ts | 3 ++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 support-portal-frontend/src/app/model/user.spec.ts create mode 100644 support-portal-frontend/src/app/model/user.ts diff --git a/support-portal-frontend/src/app/model/user.spec.ts b/support-portal-frontend/src/app/model/user.spec.ts new file mode 100644 index 0000000..b270e0e --- /dev/null +++ b/support-portal-frontend/src/app/model/user.spec.ts @@ -0,0 +1,7 @@ +import {User} from './user'; + +describe('User', () => { + it('should create an instance', () => { + expect(new User()).toBeTruthy(); + }); +}); diff --git a/support-portal-frontend/src/app/model/user.ts b/support-portal-frontend/src/app/model/user.ts new file mode 100644 index 0000000..0186df9 --- /dev/null +++ b/support-portal-frontend/src/app/model/user.ts @@ -0,0 +1,15 @@ +export class User { + userId: string; + firstName: string; + lastName: string; + username: string; + email: string; + profileImageUrl: string; + lastLoginDate: Date; + lastLoginDateDisplay: Date; + joinDate: Date; + role: string; //ROLE_USER, ROLE_ADMIN + authorities: string[]; + isActive: boolean; + isNotLocked: boolean; +} diff --git a/support-portal-frontend/src/app/service/authentication.service.ts b/support-portal-frontend/src/app/service/authentication.service.ts index aa9afd5..a45399c 100644 --- a/support-portal-frontend/src/app/service/authentication.service.ts +++ b/support-portal-frontend/src/app/service/authentication.service.ts @@ -15,7 +15,8 @@ export class AuthenticationService { } public login(userDto: UserLogin): Observable | HttpErrorResponse> { - return this.httpClient.post | HttpErrorResponse>(`${this.host}/user/login`, userDto, {observe: 'response'}); + return this.httpClient.post | HttpErrorResponse> + (`${this.host}/user/login`, userDto, {observe: 'response'}); }